UNPKG

@syncfusion/ej2-pdf

Version:

Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.

119 lines (118 loc) 3.33 kB
/** * Provides a bitwise input buffer supporting incremental bit loading and byte-aligned copying. * * @private */ export declare class _InBuffer { /** * Input byte buffer for bit-level reads. * * @private */ _buffer: number[]; /** * Start index of unread data in the buffer. * * @private */ _begin: number; /** * End index of unread data in the buffer. * * @private */ _end: number; /** * Bit buffer accumulating incoming bits. * * @private */ _bBuffer: number; /** * Number of valid bits currently in the bit buffer. * * @private */ _bInBuffer: number; constructor(); /** * Gets the total number of full bytes currently available including pending bit buffer. * * @private * @returns {number} bytes. */ readonly _bytes: number; /** * Indicates whether more input bytes are needed for further decoding. * * @private * @returns {boolean} needsInput. */ _needsInput(): boolean; /** * Ensures the requested number of bits are available by pulling bytes into the bit buffer. * * @private * @param {number} count Number of bits required. * @returns {boolean} available. */ _availableBits(count: number): boolean; /** * Loads up to 16 bits into the bit buffer and returns the current bit buffer value. * * @private * @returns {number} bitBuffer. */ _load16Bits(): number; /** * Returns a bit mask with the lowest count bits set. * * @private * @param {number} count Number of low bits to set. * @returns {number} mask. */ _getBitMask(count: number): number; /** * Retrieves the specified number of bits from the bit buffer and advances the bit position. * * @private * @param {number} count Number of bits to read. * @returns {number} value or -1 when insufficient bits. */ _getBits(count: number): number; /** * Copies bytes into the target array from the buffered bits and underlying input, returning the count copied. * * @private * @param {number[]} output Destination buffer. * @param {number} offset Start index in the destination buffer. * @param {number} length Maximum number of bytes to copy. * @returns {number} copied. */ _copyTo(output: number[], offset: number, length: number): number; /** * Sets the underlying input buffer range for subsequent bit loading operations. * * @private * @param {number[]} buffer Source input buffer. * @param {number} offset Start index of the input window. * @param {number} length Number of bytes available from offset. * @returns {void} nothing. */ _setInput(buffer: number[], offset: number, length: number): void; /** * Skips the specified number of bits in the bit buffer. * * @private * @param {number} n Number of bits to skip. * @returns {void} nothing. */ _skipBits(n: number): void; /** * Advances to the next byte boundary by discarding any remaining bits in the current byte. * * @private * @returns {void} nothing. */ _skipByteBoundary(): void; }