/** * Reverse (backward) bit reader for FSE/Huffman streams in zstd. * Modeled after zstd's reverse stream semantics: * - compute an absolute bit offset from stream start, * - consume bits by decrementing that offset, * - extract bits in little-endian bit order. */ export declare class BitReaderReverse { private readonly data; private readonly dataLength; private readonly startBit; private readonly endBit; private bitOffset; constructor(data: Uint8Array, startByteOffset: number, lengthBytes: number, skipBitsAtStart?: number); /** Read n bits (1-32), LSB first from current position (reading backward) */ readBits(n: number): number; /** * Read n bits and throw if request crosses the logical stream start. * * Use strict reads for inputs that must fail fast on truncation/corruption. * Keep readBits()/readBitsFast() for decode paths that intentionally rely on * zstd-compatible zero-fill behavior near the stream start. */ readBitsStrict(n: number): number; /** * Fast path used by validated hot loops. * Falls back to readBits() when the request crosses the logical stream start. */ readBitsFast(n: number): number; /** Fast-path strict variant that forbids crossing stream start. */ readBitsFastStrict(n: number): number; /** * Hot-loop helper: read n bits quickly, returning 0 when n is 0. */ readBitsFastOrZero(n: number): number; /** Skip trailing zero padding and end-mark bit from the stream tail. */ skipPadding(): void; get position(): number; get bitsRemaining(): number; /** Skip the first n bits at the logical start (the end of the buffer when reading backward). */ skipBitsAtEnd(n: number): void; /** Undo a previous readBits() by pushing the cursor forward. */ unreadBits(n: number): void; }