/** * A wrapper around the ArrayBuffer and DataView. Simplifies reading binary data. * * @public */ export declare class BinaryReader { /** * The underlying data to read */ readonly data: ArrayBuffer; /** * The data view allowing to access the data */ readonly view: DataView; /** * The current position */ position: number; /** * Byte order to read. Default is `true` */ littleEndian: boolean; /** * Creates a new instance of {@link BinaryReader} * * @param data - The data to read */ constructor(data: ArrayBuffer); /** * Checks whether the readers position has not reached the end of the buffer */ get canRead(): boolean; /** * Reads a specified number of bytes * * @param length - The number of bytes to read * @param output - The destination array to read into */ readBytes(length: number, output?: number[]): number[]; /** * Reads a specified number of bytes as a byte array * * @param length - The number of bytes to read */ readByteArray(length: number): Int8Array; readBuffer(buffer: number[] | Uint8Array, index: number, length: number): void; /** * Reads a single unsigned byte value */ readUByte(): number; /** * Reads a single signed byte value */ readByte(): number; /** * Reads a single unsigned short value */ readUShort(): number; /** * Reads a single signed short value */ readShort(): number; /** * Reads a single uint32 value */ readUInt(): number; /** * Reads a single int32 value */ readInt(): number; /** * Reads a two uint32 values as low and high bits. */ readLong(): number; /** * Reads a single float32 value */ readFloat(): number; /** * Reads a single float64 value */ readDouble(): number; /** * Jumps to the given position on the data array * * @param position - The new index */ seekAbsolute(position: number): void; /** * Jumps to the given position (relative to the current postion) on the data array * * @param position - The new relative position */ seekRelative(position: number): void; /** * Reads a string * * @param length - The length in bytes to read */ readString(length: number): string; /** * Returns a section of the buffer starting at current position * * @param length - The length to slice */ slice(length: number): ArrayBuffer; }