Skip to content

zstdDecompressWithDictWithCapacity

zstdDecompressWithDictWithCapacity(data, dict, capacity): Buffer

Defined in: index.d.ts:1789

Decompress Zstandard-compressed data that was compressed with a dictionary, with explicit capacity.

Use this when the decompressed size exceeds the default 256 MB limit. The capacity parameter specifies the maximum decompressed size in bytes. It is only a limit: the output buffer grows with the decompressed data, so a large capacity reserves no memory up front. capacity also bounds the window that a frame makes the decoder allocate before it writes any output: to capacity rounded up to a power of two, at least 8 MiB and at most zstd’s default of 128 MiB, so a frame that declares a larger window throws an error instead. The same dictionary used for compression must be provided.

Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

number

Buffer