Asynchronous streaming Zlib compression
• new AsyncZlib(opts
, cb?
)
Creates an asynchronous Zlib stream
Name | Type | Description |
---|---|---|
opts |
ZlibOptions |
The compression options |
cb? |
AsyncFlateStreamHandler |
The callback to call whenever data is deflated |
• new AsyncZlib(cb?
)
Creates an asynchronous Zlib stream
Name | Type | Description |
---|---|---|
cb? |
AsyncFlateStreamHandler |
The callback to call whenever data is deflated |
• ondata: AsyncFlateStreamHandler
The handler to call whenever data is available
• Optional
ondrain: AsyncFlateDrainHandler
The handler to call whenever buffered source data is processed (i.e. queuedSize
updates)
• queuedSize: number
The number of uncompressed bytes buffered in the stream
• terminate: AsyncTerminable
A method to terminate the stream's internal worker. Subsequent calls to push() will silently fail.
▸ flush(): void
Flushes buffered uncompressed data. Useful to immediately retrieve the zlibbed output for small inputs.
void
▸ push(chunk
, final?
): void
Pushes a chunk to be deflated
Name | Type | Description |
---|---|---|
chunk |
Uint8Array |
The chunk to push |
final? |
boolean |
Whether this is the last chunk |
void