Class Deflate
Index
Constructors
constructor
-
Creates a DEFLATE stream
Parameters
- opts: DeflateOptions
The compression options
Optionalcb: FlateStreamHandlerThe callback to call whenever data is deflated
Returns Deflate
- opts: DeflateOptions
-
Creates a DEFLATE stream
Parameters
Optionalcb: FlateStreamHandlerThe callback to call whenever data is deflated
Returns Deflate
Methods
flush
-
Flushes buffered uncompressed data. Useful to immediately retrieve the deflated 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. A separate DEFLATE stream may be concatenated with the current output after a sync flush.
Returns void
push
-
Pushes a chunk to be deflated
Parameters
- chunk: Uint8Array
The chunk to push
Optionalfinal: booleanWhether this is the last chunk
Returns void
- chunk: Uint8Array
Streaming DEFLATE compression