"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var ConverterError = /** @class */ (function (_super) {
    __extends(ConverterError, _super);
    function ConverterError(code, msg, cause) {
        var _this = _super.call(this, msg) || this;
        _this.code = code;
        _this.cause = cause;
        return _this;
    }
    ConverterError.unexpectedBufferSize = function (expected, buffer) {
        return new ConverterError(ConverterError.Code.UnexpectedBufferSizeError, "Expected buffer of " + expected + " byte(s) but found only " + buffer.length + " byte(s)");
    };
    ConverterError.nullBufferError = function (msg) {
        return new ConverterError(ConverterError.Code.NullBufferError, msg);
    };
    return ConverterError;
}(Error));
exports.ConverterError = ConverterError;
(function (ConverterError) {
    var Code;
    (function (Code) {
        Code["UnexpectedBufferSizeError"] = "UnexpectedBufferSizeError";
        Code["NullBufferError"] = "NullBufferError";
    })(Code = ConverterError.Code || (ConverterError.Code = {}));
})(ConverterError = exports.ConverterError || (exports.ConverterError = {}));
exports.ConverterError = ConverterError;
