import type { InputType, ZlibOptions } from "zlib"; export declare enum Endian { LITTLE_ENDIAN = "LE", BIG_ENDIAN = "BE" } export default class ByteArray { buffer: Buffer; /** * The current position */ hashposition: number; /** * The byte order (default is Big Endian) */ protected hashendian: 'LE' | 'BE'; constructor(buffer: Buffer | Array | number | Uint8Array); /** * Override for Object.prototype.toString.call */ get [Symbol.toStringTag](): string; /** * Returns the current endian mode ("LE" or "BE") */ get endian(): "LE" | "BE"; /** * Sets the endian. */ set endian(value: "LE" | "BE"); /** * Returns the length of the buffer. */ get length(): number; /** * Sets the length of the buffer */ set length(value: number); /** * Returns the amount of bytes available */ get bytesAvailable(): number; static compressor(buf: InputType, options?: ZlibOptions): Buffer; static uncompressor(buf: InputType, options?: ZlibOptions): Buffer; /** * Expands the buffer when needed */ hashexpand(value: number): void; /** * Clears the buffer and sets the position to 0 */ clear(): void; /** * idk wtf */ compress(): void; /** * Reads a boolean */ readBoolean(): boolean; /** * Reads a signed byte * @returns */ readByte(): number; /** * Reads multiple signed bytes from a ByteArray */ readBytes(bytes: ByteArray, offset?: number, length?: number): void; /** * @description Reads a double */ readDouble(): number; /** * Reads a float */ readFloat(): number; /** * Reads a signed int */ readInt(): number; /** * Reads a signed long */ readLong(): bigint; /** * Reads a multibyte string */ readMultiByte(length: number, charset?: string): string; /** * Reads a signed short */ readShort(): number; /** * Reads an unsigned byte */ readUnsignedByte(): number; /** * Reads an unsigned int */ readUnsignedInt(): number; /** * Reads an unsigned short */ readUnsignedShort(): number; /** * Reads an unsigned long */ readUnsignedLong(): bigint; /** * Reads a UTF-8 string */ readUTF(): string; /** * Reads UTF-8 bytes */ readUTFBytes(length: number): string; /** * Converts the buffer to JSON */ toJSON(): number[]; /** * Converts the buffer to a string */ toString(charset?: string): string; /** * Decompresses the buffer */ uncompress(): void; /** * Writes a boolean (internally a 0 or 1) */ writeBoolean(value: boolean): void; /** * Writes a signed byte */ writeByte(value: number): void; /** * Writes multiple signed bytes to a ByteArray */ writeBytes(bytes: ByteArray | Buffer, offset?: number, length?: number): void; /** * Writes a double */ writeDouble(value: number): void; /** * Writes a float */ writeFloat(value: number): void; /** * Writes a signed int */ writeInt(value: number): void; /** * Writes a signed long */ writeLong(value: bigint): void; /** * Writes a multibyte string */ writeMultiByte(value: string, charset?: string): void; /** * Writes a signed short */ writeShort(value: number): void; /** * Writes an unsigned byte */ writeUnsignedByte(value: number): void; /** * Writes a unsigned int */ writeUnsignedInt(value: number): void; /** * Writes an unsigned short */ writeUnsignedShort(value: number): void; /** * Writes an unsigned long */ writeUnsignedLong(value: bigint): void; /** * Writes a UTF-8 string */ writeUTF(value: string): void; /** * Writes UTF-8 bytes */ writeUTFBytes(value: string): void; /** * Reads a buffer function */ private hashreadBufferFunc; /** * Writes a buffer function */ private hashwriteBufferFunc; }