Class Decompressor

High-level interface for customized single-pass Zstandard decompression.

const dec = new Decompressor();
const result = dec.decompress(compressedBuffer);
const dec = new Decompressor();
dec.setParameters({windowLogMax: 24});
dec.loadDictionary(fs.readFileSync('path/to/dictionary.dct'));
const result = dec.decompress(compressedBuffer);

Constructors

Methods

  • Decompress the data in buffer with the configured dictionary/parameters.

    Parameters

    • buffer: Uint8Array

      Compressed data

    Returns Buffer

    A new buffer with the uncompressed data

  • Load a compression dictionary from the provided buffer.

    The loaded dictionary will be used for all future decompress calls until removed or replaced. Passing an empty buffer to this function will remove a previously loaded dictionary.

    Parameters

    • data: Uint8Array

    Returns void

  • Reset the decompressor state to only the provided parameters.

    Any loaded dictionary will be cleared, and any parameters not specified will be reset to their default values.

    Parameters

    Returns void

  • Modify decompression parameters.

    Parameters not specified will be left at their current values.

    Parameters

    Returns void