node-pkware
Version:
nodejs implementation of StormLib's pkware compressor/de-compressor
34 lines (33 loc) • 1.1 kB
TypeScript
import { type CompressionType, type DictionarySize } from '../simple/types.js';
export declare class Implode {
private inputBuffer;
private inputBufferView;
private inputBufferStartIndex;
private readonly outputBuffer;
private outputBufferView;
private outputBufferSize;
private dictionarySizeMask;
private readonly distCodes;
private readonly distBits;
private outBits;
private readonly nChBits;
private readonly nChCodes;
constructor(input: ArrayBufferLike, compressionType: CompressionType, dictionarySize: DictionarySize);
getResult(): ArrayBuffer;
private setupTables;
private outputHeader;
private processInput;
private writeTerminationLiteral;
/**
* @returns false - non flushable
* @returns true - flushable
* @returns null - flushable, but there might be a better repetition
*/
private isRepetitionFlushable;
/**
* repetitions are at least 2 bytes long,
* so the initial 2 bytes can be moved to the output as is
*/
private skipFirstTwoBytes;
private outputBits;
}