Class Zlib
Index
Constructors
constructor
-
Creates a Zlib stream
Parameters
- opts: ZlibOptions
The compression options
Optionalcb: FlateStreamHandlerThe callback to call whenever data is deflated
Returns Zlib
- opts: ZlibOptions
-
Creates a Zlib stream
Parameters
Optionalcb: FlateStreamHandlerThe callback to call whenever data is deflated
Returns Zlib
Methods
flush
-
Flushes buffered uncompressed data. Useful to immediately retrieve the zlibbed output for small inputs.
Parameters
Optionalsync: booleanWhether to flush to a byte boundary. A sync flush takes 4-5 extra bytes, but guarantees all pushed data is immediately decompressible.
Returns void
push
-
Pushes a chunk to be zlibbed
Parameters
- chunk: Uint8Array
The chunk to push
Optionalfinal: booleanWhether this is the last chunk
Returns void
- chunk: Uint8Array
Streaming Zlib compression