Skip to content

zstdDecompressWithCapacity

zstdDecompressWithCapacity(data, capacity): Buffer

Defined in: index.d.ts:1729

Decompress Zstandard-compressed data 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.

Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>

number

Buffer