{
  "version": 3,
  "sources": ["../src/iobuffer.ts"],
  "sourcesContent": ["import { decode, encode } from './text.js'\n\nconst defaultByteLength = 1024 * 8\n\nconst hostBigEndian = (() => {\n    const array = new Uint8Array(4)\n    const view = new Uint32Array(array.buffer)\n    return !((view[0] = 1) & (array[0] as number))\n})()\n\nexport type InputData = number | ArrayBufferLike | ArrayBufferView | IOBuffer;\n\nconst typedArrays = {\n    int8: globalThis.Int8Array,\n    uint8: globalThis.Uint8Array,\n    int16: globalThis.Int16Array,\n    uint16: globalThis.Uint16Array,\n    int32: globalThis.Int32Array,\n    uint32: globalThis.Uint32Array,\n    uint64: globalThis.BigUint64Array,\n    int64: globalThis.BigInt64Array,\n    float32: globalThis.Float32Array,\n    float64: globalThis.Float64Array,\n}\n\ntype TypedArrays = typeof typedArrays;\n\nexport interface IOBufferOptions {\n  /**\n   * Ignore the first n bytes of the ArrayBuffer.\n   */\n  offset?:number;\n}\n\nexport class IOBuffer {\n    /**\n   * Reference to the internal ArrayBuffer object.\n   */\n    public buffer:ArrayBufferLike\n\n    /**\n   * Byte length of the internal ArrayBuffer.\n   */\n    public byteLength:number\n\n    /**\n   * Byte offset of the internal ArrayBuffer.\n   */\n    public byteOffset:number\n\n    /**\n   * Byte length of the internal ArrayBuffer.\n   */\n    public length:number\n\n    /**\n   * The current offset of the buffer's pointer.\n   */\n    public offset:number\n\n    private lastWrittenByte:number\n    private littleEndian:boolean\n\n    private _data:DataView\n    private _mark:number\n    private _marks:number[]\n\n    /**\n   * Create a new IOBuffer.\n   * @param data - The data to construct the IOBuffer with.\n   * If data is a number, it will be the new buffer's length<br>\n   * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>\n   * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,\n   * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.\n   * @param options - An object for the options.\n   * @returns A new IOBuffer instance.\n   */\n    public constructor (\n        data:InputData = defaultByteLength,\n        options:IOBufferOptions = {},\n    ) {\n        let dataIsGiven = false\n        if (typeof data === 'number') {\n            data = new ArrayBuffer(data)\n        } else {\n            dataIsGiven = true\n            this.lastWrittenByte = data.byteLength\n        }\n        const offset = options.offset ? options.offset >>> 0 : 0\n        const byteLength = data.byteLength - offset\n        let dvOffset = offset\n        if (ArrayBuffer.isView(data) || data instanceof IOBuffer) {\n            if (data.byteLength !== data.buffer.byteLength) {\n                dvOffset = data.byteOffset + offset\n            }\n            data = data.buffer\n        }\n        if (dataIsGiven) {\n            this.lastWrittenByte = byteLength\n        } else {\n            this.lastWrittenByte = 0\n        }\n        this.buffer = data\n        this.length = byteLength\n        this.byteLength = byteLength\n        this.byteOffset = dvOffset\n        this.offset = 0\n        this.littleEndian = true\n        this._data = new DataView(this.buffer, dvOffset, byteLength)\n        this._mark = 0\n        this._marks = []\n    }\n\n    /**\n   * Checks if the memory allocated to the buffer is sufficient to store more\n   * bytes after the offset.\n   * @param byteLength - The needed memory in bytes.\n   * @returns `true` if there is sufficient space and `false` otherwise.\n   */\n    public available (byteLength = 1):boolean {\n        return this.offset + byteLength <= this.length\n    }\n\n    /**\n   * Check if little-endian mode is used for reading and writing multi-byte\n   * values.\n   * @returns `true` if little-endian mode is used, `false` otherwise.\n   */\n    public isLittleEndian ():boolean {\n        return this.littleEndian\n    }\n\n    /**\n   * Set little-endian mode for reading and writing multi-byte values.\n   * @returns This.\n   */\n    public setLittleEndian ():this {\n        this.littleEndian = true\n        return this\n    }\n\n    /**\n   * Check if big-endian mode is used for reading and writing multi-byte values.\n   * @returns `true` if big-endian mode is used, `false` otherwise.\n   */\n    public isBigEndian ():boolean {\n        return !this.littleEndian\n    }\n\n    /**\n   * Switches to big-endian mode for reading and writing multi-byte values.\n   * @returns This.\n   */\n    public setBigEndian ():this {\n        this.littleEndian = false\n        return this\n    }\n\n    /**\n   * Move the pointer n bytes forward.\n   * @param n - Number of bytes to skip.\n   * @returns This.\n   */\n    public skip (n = 1): this {\n        this.offset += n\n        return this\n    }\n\n    /**\n   * Move the pointer n bytes backward.\n   * @param n - Number of bytes to move back.\n   * @returns This.\n   */\n    public back (n = 1): this {\n        this.offset -= n\n        return this\n    }\n\n    /**\n   * Move the pointer to the given offset.\n   * @param offset - The offset to move to.\n   * @returns This.\n   */\n    public seek (offset: number): this {\n        this.offset = offset\n        return this\n    }\n\n    /**\n   * Store the current pointer offset.\n   * @see {@link IOBuffer#reset}\n   * @returns This.\n   */\n    public mark (): this {\n        this._mark = this.offset\n        return this\n    }\n\n    /**\n   * Move the pointer back to the last pointer offset set by mark.\n   * @see {@link IOBuffer#mark}\n   * @returns This.\n   */\n    public reset (): this {\n        this.offset = this._mark\n        return this\n    }\n\n    /**\n   * Push the current pointer offset to the mark stack.\n   * @see {@link IOBuffer#popMark}\n   * @returns This.\n   */\n    public pushMark (): this {\n        this._marks.push(this.offset)\n        return this\n    }\n\n    /**\n   * Pop the last pointer offset from the mark stack, and set the current\n   * pointer offset to the popped value.\n   * @see {@link IOBuffer#pushMark}\n   * @returns This.\n   */\n    public popMark (): this {\n        const offset = this._marks.pop()\n        if (offset === undefined) {\n            throw new Error('Mark stack empty')\n        }\n        this.seek(offset)\n        return this\n    }\n\n    /**\n   * Move the pointer offset back to 0.\n   * @returns This.\n   */\n    public rewind (): this {\n        this.offset = 0\n        return this\n    }\n\n    /**\n   * Make sure the buffer has sufficient memory to write a given byteLength at\n   * the current pointer offset.\n   * If the buffer's memory is insufficient, this method will create a new\n   * buffer (a copy) with a length that is twice (byteLength + current offset).\n   * @param byteLength - The needed memory in bytes.\n   * @returns This.\n   */\n    public ensureAvailable (byteLength = 1): this {\n        if (!this.available(byteLength)) {\n            const lengthNeeded = this.offset + byteLength\n            const newLength = lengthNeeded * 2\n            const newArray = new Uint8Array(newLength)\n            newArray.set(new Uint8Array(this.buffer))\n            this.buffer = newArray.buffer\n            this.length = newLength\n            this.byteLength = newLength\n            this._data = new DataView(this.buffer)\n        }\n        return this\n    }\n\n    /**\n   * Read a byte and return false if the byte's value is 0, or true otherwise.\n   * Moves pointer forward by one byte.\n   * @returns The read boolean.\n   */\n    public readBoolean (): boolean {\n        return this.readUint8() !== 0\n    }\n\n    /**\n   * Read a signed 8-bit integer and move pointer forward by 1 byte.\n   * @returns The read byte.\n   */\n    public readInt8 (): number {\n        return this._data.getInt8(this.offset++)\n    }\n\n    /**\n   * Read an unsigned 8-bit integer and move pointer forward by 1 byte.\n   * @returns The read byte.\n   */\n    public readUint8 (): number {\n        return this._data.getUint8(this.offset++)\n    }\n\n    /**\n   * Alias for {@link IOBuffer#readUint8}.\n   * @returns The read byte.\n   */\n    public readByte (): number {\n        return this.readUint8()\n    }\n\n    /**\n   * Read `n` bytes and move pointer forward by `n` bytes.\n   * @param n - Number of bytes to read.\n   * @returns The read bytes.\n   */\n    public readBytes (n = 1): Uint8Array {\n        return this.readArray(n, 'uint8')\n    }\n\n    /**\n   * Creates an array of corresponding to the type `type` and size `size`.\n   * For example, type `uint8` will create a `Uint8Array`.\n   * @param size - size of the resulting array\n   * @param type - number type of elements to read\n   * @returns The read array.\n   */\n    public readArray<T extends keyof typeof typedArrays> (\n        size: number,\n        type: T,\n    ): InstanceType<TypedArrays[T]> {\n        const bytes = typedArrays[type].BYTES_PER_ELEMENT * size\n        const offset = this.byteOffset + this.offset\n        const slice = this.buffer.slice(offset, offset + bytes)\n        if (\n            this.littleEndian === hostBigEndian &&\n      type !== 'uint8' &&\n      type !== 'int8'\n        ) {\n            const slice = new Uint8Array(this.buffer.slice(offset, offset + bytes))\n            slice.reverse()\n            const returnArray = new typedArrays[type](slice.buffer as ArrayBuffer)\n            this.offset += bytes\n            returnArray.reverse()\n            return returnArray as InstanceType<TypedArrays[T]>\n        }\n        const returnArray = new typedArrays[type](slice as ArrayBuffer)\n        this.offset += bytes\n        return returnArray as InstanceType<TypedArrays[T]>\n    }\n\n    /**\n   * Read a 16-bit signed integer and move pointer forward by 2 bytes.\n   * @returns The read value.\n   */\n    public readInt16 (): number {\n        const value = this._data.getInt16(this.offset, this.littleEndian)\n        this.offset += 2\n        return value\n    }\n\n    /**\n   * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.\n   * @returns The read value.\n   */\n    public readUint16 (): number {\n        const value = this._data.getUint16(this.offset, this.littleEndian)\n        this.offset += 2\n        return value\n    }\n\n    /**\n   * Read a 32-bit signed integer and move pointer forward by 4 bytes.\n   * @returns The read value.\n   */\n    public readInt32 (): number {\n        const value = this._data.getInt32(this.offset, this.littleEndian)\n        this.offset += 4\n        return value\n    }\n\n    /**\n   * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.\n   * @returns The read value.\n   */\n    public readUint32 (): number {\n        const value = this._data.getUint32(this.offset, this.littleEndian)\n        this.offset += 4\n        return value\n    }\n\n    /**\n   * Read a 32-bit floating number and move pointer forward by 4 bytes.\n   * @returns The read value.\n   */\n    public readFloat32 (): number {\n        const value = this._data.getFloat32(this.offset, this.littleEndian)\n        this.offset += 4\n        return value\n    }\n\n    /**\n   * Read a 64-bit floating number and move pointer forward by 8 bytes.\n   * @returns The read value.\n   */\n    public readFloat64 (): number {\n        const value = this._data.getFloat64(this.offset, this.littleEndian)\n        this.offset += 8\n        return value\n    }\n\n    /**\n   * Read a 64-bit signed integer number and move pointer forward by 8 bytes.\n   * @returns The read value.\n   */\n    public readBigInt64 (): bigint {\n        const value = this._data.getBigInt64(this.offset, this.littleEndian)\n        this.offset += 8\n        return value\n    }\n\n    /**\n   * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.\n   * @returns The read value.\n   */\n    public readBigUint64 (): bigint {\n        const value = this._data.getBigUint64(this.offset, this.littleEndian)\n        this.offset += 8\n        return value\n    }\n\n    /**\n   * Read a 1-byte ASCII character and move pointer forward by 1 byte.\n   * @returns The read character.\n   */\n    public readChar (): string {\n        return String.fromCharCode(this.readInt8())\n    }\n\n    /**\n   * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.\n   * @param n - Number of characters to read.\n   * @returns The read characters.\n   */\n    public readChars (n = 1): string {\n        let result = ''\n        for (let i = 0; i < n; i++) {\n            result += this.readChar()\n        }\n        return result\n    }\n\n    /**\n   * Read the next `n` bytes, return a UTF-8 decoded string and move pointer\n   * forward by `n` bytes.\n   * @param n - Number of bytes to read.\n   * @returns The decoded string.\n   */\n    public readUtf8 (n = 1): string {\n        return decode(this.readBytes(n))\n    }\n\n    /**\n   * Read the next `n` bytes, return a string decoded with `encoding` and move pointer\n   * forward by `n` bytes.\n   * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}\n   * @param n - Number of bytes to read.\n   * @param encoding - The encoding to use. Default is 'utf8'.\n   * @returns The decoded string.\n   */\n    public decodeText (n = 1, encoding = 'utf8'): string {\n        return decode(this.readBytes(n), encoding)\n    }\n\n    /**\n   * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer\n   * forward by 1 byte.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeBoolean (value: unknown): this {\n        this.writeUint8(value ? 0xff : 0x00)\n        return this\n    }\n\n    /**\n   * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeInt8 (value: number): this {\n        this.ensureAvailable(1)\n        this._data.setInt8(this.offset++, value)\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as an 8-bit unsigned integer and move pointer forward by 1\n   * byte.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeUint8 (value: number): this {\n        this.ensureAvailable(1)\n        this._data.setUint8(this.offset++, value)\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * An alias for {@link IOBuffer#writeUint8}.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeByte (value: number): this {\n        return this.writeUint8(value)\n    }\n\n    /**\n   * Write all elements of `bytes` as uint8 values and move pointer forward by\n   * `bytes.length` bytes.\n   * @param bytes - The array of bytes to write.\n   * @returns This.\n   */\n    public writeBytes (bytes: ArrayLike<number>): this {\n        this.ensureAvailable(bytes.length)\n        // eslint-disable-next-line @typescript-eslint/prefer-for-of\n        for (let i = 0; i < bytes.length; i++) {\n            this._data.setUint8(this.offset++, bytes[i] as number)\n        }\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 16-bit signed integer and move pointer forward by 2\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeInt16 (value: number): this {\n        this.ensureAvailable(2)\n        this._data.setInt16(this.offset, value, this.littleEndian)\n        this.offset += 2\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 16-bit unsigned integer and move pointer forward by 2\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeUint16 (value: number): this {\n        this.ensureAvailable(2)\n        this._data.setUint16(this.offset, value, this.littleEndian)\n        this.offset += 2\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 32-bit signed integer and move pointer forward by 4\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeInt32 (value: number): this {\n        this.ensureAvailable(4)\n        this._data.setInt32(this.offset, value, this.littleEndian)\n        this.offset += 4\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 32-bit unsigned integer and move pointer forward by 4\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeUint32 (value: number): this {\n        this.ensureAvailable(4)\n        this._data.setUint32(this.offset, value, this.littleEndian)\n        this.offset += 4\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 32-bit floating number and move pointer forward by 4\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeFloat32 (value: number): this {\n        this.ensureAvailable(4)\n        this._data.setFloat32(this.offset, value, this.littleEndian)\n        this.offset += 4\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 64-bit floating number and move pointer forward by 8\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeFloat64 (value: number): this {\n        this.ensureAvailable(8)\n        this._data.setFloat64(this.offset, value, this.littleEndian)\n        this.offset += 8\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 64-bit signed bigint and move pointer forward by 8\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeBigInt64 (value: bigint): this {\n        this.ensureAvailable(8)\n        this._data.setBigInt64(this.offset, value, this.littleEndian)\n        this.offset += 8\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8\n   * bytes.\n   * @param value - The value to write.\n   * @returns This.\n   */\n    public writeBigUint64 (value: bigint): this {\n        this.ensureAvailable(8)\n        this._data.setBigUint64(this.offset, value, this.littleEndian)\n        this.offset += 8\n        this._updateLastWrittenByte()\n        return this\n    }\n\n    /**\n   * Write the charCode of `str`'s first character as an 8-bit unsigned integer\n   * and move pointer forward by 1 byte.\n   * @param str - The character to write.\n   * @returns This.\n   */\n    public writeChar (str: string): this {\n        return this.writeUint8(str.charCodeAt(0))\n    }\n\n    /**\n   * Write the charCodes of all `str`'s characters as 8-bit unsigned integers\n   * and move pointer forward by `str.length` bytes.\n   * @param str - The characters to write.\n   * @returns This.\n   */\n    public writeChars (str: string): this {\n        for (let i = 0; i < str.length; i++) {\n            this.writeUint8(str.charCodeAt(i))\n        }\n        return this\n    }\n\n    /**\n   * UTF-8 encode and write `str` to the current pointer offset and move pointer\n   * forward according to the encoded length.\n   * @param str - The string to write.\n   * @returns This.\n   */\n    public writeUtf8 (str: string): this {\n        return this.writeBytes(encode(str))\n    }\n\n    /**\n   * Export a Uint8Array view of the internal buffer.\n   * The view starts at the byte offset and its length\n   * is calculated to stop at the last written byte or the original length.\n   * @returns A new Uint8Array view.\n   */\n    public toArray (): Uint8Array {\n        return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte)\n    }\n\n    /**\n   *  Get the total number of bytes written so far, regardless of the current offset.\n   * @returns - Total number of bytes.\n   */\n    public getWrittenByteLength () {\n        return this.lastWrittenByte - this.byteOffset\n    }\n\n    /**\n   * Update the last written byte offset\n   * @private\n   */\n    private _updateLastWrittenByte (): void {\n        if (this.offset > this.lastWrittenByte) {\n            this.lastWrittenByte = this.offset\n        }\n    }\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA+B;AAE/B,MAAM,oBAAoB,OAAO;AAEjC,MAAM,iBAAiB,MAAM;AACzB,QAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,QAAM,OAAO,IAAI,YAAY,MAAM,MAAM;AACzC,SAAO,GAAG,KAAK,CAAC,IAAI,KAAM,MAAM,CAAC;AACrC,GAAG;AAIH,MAAM,cAAc;AAAA,EAChB,MAAM,WAAW;AAAA,EACjB,OAAO,WAAW;AAAA,EAClB,OAAO,WAAW;AAAA,EAClB,QAAQ,WAAW;AAAA,EACnB,OAAO,WAAW;AAAA,EAClB,QAAQ,WAAW;AAAA,EACnB,QAAQ,WAAW;AAAA,EACnB,OAAO,WAAW;AAAA,EAClB,SAAS,WAAW;AAAA,EACpB,SAAS,WAAW;AACxB;AAWO,MAAM,SAAS;AAAA,EAlCtB,OAkCsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAIX;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA,EAEC;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYD,YACH,OAAiB,mBACjB,UAA0B,CAAC,GAC7B;AACE,QAAI,cAAc;AAClB,QAAI,OAAO,SAAS,UAAU;AAC1B,aAAO,IAAI,YAAY,IAAI;AAAA,IAC/B,OAAO;AACH,oBAAc;AACd,WAAK,kBAAkB,KAAK;AAAA,IAChC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