"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("../../../../core");
var StringConverter = /** @class */ (function () {
    function StringConverter() {
    }
    StringConverter.prototype.decode = function (body) {
        if (body != null) {
            return core_1.FormatHelper.toAsciiString(body);
        }
        else {
            return "";
        }
    };
    StringConverter.prototype.encode = function (value) {
        return core_1.FormatHelper.toByteBuffer(value);
    };
    StringConverter.instance = function () {
        if (!StringConverter._instance) {
            StringConverter._instance = new StringConverter();
        }
        return StringConverter._instance;
    };
    return StringConverter;
}());
exports.StringConverter = StringConverter;
