"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.skipTlv = exports.getTlv = void 0;
const bufio_1 = require("@node-dlc/bufio");
// TODO: add unit tests
function getTlv(reader) {
    const type = reader.readBigSize();
    const length = reader.readBigSize();
    const body = reader.readBytes(Number(length));
    const writer = new bufio_1.BufferWriter();
    writer.writeBigSize(type);
    writer.writeBigSize(length);
    writer.writeBytes(body);
    return writer.toBuffer();
}
exports.getTlv = getTlv;
function skipTlv(reader) {
    reader.readBigSize();
    const length = reader.readBigSize();
    reader.readBytes(Number(length));
}
exports.skipTlv = skipTlv;
//# sourceMappingURL=getTlv.js.map