var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { CodeError } from '@iotize/common/error';
var ConverterError = /** @class */ (function (_super) {
    __extends(ConverterError, _super);
    function ConverterError(code, msg, cause) {
        var _this = _super.call(this, msg, code) || this;
        _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;
}(CodeError));
export { ConverterError };
(function (ConverterError) {
    var Code;
    (function (Code) {
        Code["UnexpectedBufferSizeError"] = "UnexpectedBufferSizeError";
        Code["NullBufferError"] = "NullBufferError";
    })(Code = ConverterError.Code || (ConverterError.Code = {}));
})(ConverterError || (ConverterError = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3IuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AaW90aXplL3RhcC9jbGllbnQvaW1wbC8iLCJzb3VyY2VzIjpbImxpYi9jb252ZXJ0ZXIvZXJyb3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUVqRDtJQUFvQyxrQ0FBOEI7SUFDOUQsd0JBQVksSUFBeUIsRUFBRSxHQUFXLEVBQVMsS0FBYTt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