export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; /** Anything we can build a read-only byte stream over. */ export type ByteSource = ArrayBuffer | SharedArrayBuffer | ArrayBufferView | { buffer: ArrayBufferLike; byteOffset: number; byteLength: number; } | number | null | undefined; /** * DataStreamReaderLite (read-only). * * Reads scalars, arrays and strings from an ArrayBuffer (or any * ArrayBuffer view such as Node.js Buffer / Uint8Array / DataView). * Unlike the original DataStream implementation this class never writes, * never reallocates and never copies the backing store: all reads are * bounds-checked and throw a RangeError on overrun instead of silently * clamping, so corrupt files fail loudly at the read site. */ export default class DataStreamReaderLite { position: number; endianness: boolean; private _bytes; private _view; constructor(arrayBuffer?: ByteSource, byteOffset?: number, endianness?: boolean); /** Big-endian const to use as endianness. */ static readonly BIG_ENDIAN: boolean; /** Little-endian const to use as endianness. */ static readonly LITTLE_ENDIAN: boolean; /** * Native endianness. Either DataStreamReaderLite.BIG_ENDIAN or * DataStreamReaderLite.LITTLE_ENDIAN depending on the platform. */ static readonly endianness: boolean; /** Number of readable bytes in this stream. */ get byteLength(): number; /** Raw readable bytes (live view, do not mutate). */ get bytes(): Uint8Array; private ensureAvailable; /** * Sets the read position. Values are clamped between 0 and the stream * length (historical behavior); use the throwing read methods to detect * corrupt offsets. */ seek(pos: number): void; /** True when the read pointer is at (or past) the end of the buffer. */ isEof(): boolean; /** * Returns a copy of the next `length` bytes. * (The historical name is kept; unlike the original this returns a copy, * never a live mapping into a growable buffer.) */ mapUint8Array(length: number): Uint8Array; /** Reads a 16-bit int at the given absolute offset. Throws RangeError on overrun. */ readShort(offset: number): number; /** Reads an 8-bit int at the given absolute offset. Throws RangeError on overrun. */ readByte(offset: number): number; /** Reads a UCS-2 string of `length` characters at the given absolute offset. Throws RangeError on overrun. */ readStringAt(offset: number, length: number): string; /** Reads a 32-bit int at the given absolute offset. Throws RangeError on overrun. */ readInt(offset: number): number; /** * Reads an Int32Array of the desired length and endianness. * Uses a bulk copy on little-endian platforms, per-element DataView * reads otherwise, so the result is correct regardless of platform. */ readInt32Array(length: number, e?: boolean): Int32Array; /** Reads an Int8Array of the desired length. */ readInt8Array(length: number): Int8Array; /** Reads a Uint16Array of the desired length and endianness. */ readUint16Array(length: number, e?: boolean): Uint16Array; /** Reads a Uint8Array copy of the desired length. */ readUint8Array(length: number): Uint8Array; /** Reads a 32-bit int with the desired endianness. */ readInt32(e?: boolean): number; /** Reads an unsigned 32-bit int with the desired endianness. */ readUint32(e?: boolean): number; /** Reads a 16-bit int with the desired endianness. */ readInt16(e?: boolean): number; /** Reads an unsigned 16-bit int with the desired endianness. */ readUint16(e?: boolean): number; /** Reads an 8-bit int. */ readInt8(): number; /** Reads an unsigned 8-bit int. */ readUint8(): number; /** * Copies byteLength bytes from the src buffer at srcOffset to the * dst buffer at dstOffset. */ static memcpy(dst: ArrayBufferLike, dstOffset: number, src: ArrayBufferLike, srcOffset: number, byteLength: number): void; /** * Creates a string from an array of character codes, chunk by chunk. */ static createStringFromArray(array: TypedArray): string; /** Reads a UCS-2/UTF-16LE string of `length` characters. */ readUCS2String(length: number, endianness?: boolean): string; /** * Reads a string of `length` bytes. Defaults to single-byte * (windows-1252, ASCII-compatible) decoding; any other TextDecoder * encoding label may be passed explicitly. */ readString(length: number, encoding?: string): string; } //# sourceMappingURL=data-stream-reader-lite.d.ts.map