dreamworkAPI
Ctrl K
GitHub
classDocs / gzip / Compressor

gzip.Compressor

classsharedmenusource
Object → deflate.Compressor → gzip.Compressor

The gzip stream compressor object.

Constructor

deflate.Compressor(options: gzip.Options?): gzip.Compressor

Methods

flushCompresses all input and returns the gzip stream.
flushCompresses all input, writes the last block and returns the compressed data.
resetDrops all input and output, the next update starts a new stream with the same options.
resetDrops all input and output, the next update starts a new stream with the same options.
updateAdds the string to the stream.
updateAdds the string to the stream.

#Compressor:flush

sharedmenunodiscardsource
function gzip.Compressor:flush(): string

Compresses all input and returns the gzip stream.

The stream is reset after this, so the compressor can be used for the next stream.

Returns
TypeNameDescription
stringcompressed_data

#Compressor:flush

sharedmenunodiscardsource
function deflate.Compressor:flush(): string

Compresses all input, writes the last block and returns the compressed data.

The stream is reset after this, so the compressor can be used for the next stream.

Returns
TypeNameDescription
stringcompressed_data

#Compressor:reset

sharedmenusource
function gzip.Compressor:reset(): gzip.Compressor

Drops all input and output, the next update starts a new stream with the same options.

Returns
TypeNameDescription
gzip.Compressorself

#Compressor:reset

sharedmenusource
function deflate.Compressor:reset(): deflate.Compressor

Drops all input and output, the next update starts a new stream with the same options.

Returns
TypeNameDescription
deflate.Compressorself

#Compressor:update

sharedmenusource
function gzip.Compressor:update(raw_data: string): gzip.Compressor

Adds the string to the stream.

Input is compressed in parts of at least 32768 bytes, the output is the same as gzip.compress of all input.

Parameters
NameTypeDescription
raw_datastringThe string to add.
Returns
TypeNameDescription
gzip.Compressorself

#Compressor:update

sharedmenusource
function deflate.Compressor:update(raw_data: string): deflate.Compressor

Adds the string to the stream.

Input is compressed in parts of at least 32768 bytes, the last 258 bytes always wait for more input, since a match can continue into it.

The output is the same as deflate.compress of all input, unless another stream or deflate.compress is used between the updates, then the unfinished block is written early, which costs a few bytes.

Parameters
NameTypeDescription
raw_datastringThe string to add.
Returns
TypeNameDescription
deflate.Compressorself
Generated from the dreamwork meta branch.