Skip to content

createLz4DecompressStream

createLz4DecompressStream(maxOutputSize?): TransformStream<ArrayBufferLike | ArrayBufferView<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>

Defined in: streams.d.ts:197

Create a streaming LZ4 frame decompression TransformStream.

Uses the Web Streams API (TransformStream) to provide chunked LZ4 decompression. It emits the content of each block as soon as all of the block has arrived, and holds at most one block of the input.

The input may hold several concatenated frames, including skippable and legacy frames. The stream errors if the input ends inside a frame, including empty input, or as soon as data that is not a frame follows a frame.

Input chunks may be any ArrayBuffer, SharedArrayBuffer or ArrayBufferView, read byte for byte: a Uint16Array is not converted element by element.

number

Maximum decompressed output size in bytes. Default is 256 MB.

TransformStream<ArrayBufferLike | ArrayBufferView<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>