dreamworkAPI
Ctrl K
GitHub
classDocs / deflate / Decompressor

deflate.Decompressor

classsharedmenusource
Object → deflate.Decompressor with deflate.InflateStream

The DEFLATE stream decompressor object.

Constructor

deflate.Decompressor(dictionary: string?): deflate.Decompressor

Methods

flushDecodes all input and returns the decompressed data.
resetDrops all input and output, the next update starts a new stream with the same dictionary.
updateAdds the compressed string to the stream.

#Decompressor:flush

sharedmenunodiscardsource
function deflate.Decompressor:flush(): string, string

Decodes all input and returns the decompressed data.

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

Throws an error on malformed or truncated data; call via pcall() when processing untrusted input.

Returns
TypeNameDescription
stringdecompressed_dataThe decompressed string.
stringremaining_dataThe data after the end of the stream (like the zlib or gzip trailer).

#Decompressor:reset

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

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

Returns
TypeNameDescription
deflate.Decompressorself

#Decompressor:update

sharedmenusource
function deflate.Decompressor:update(compressed_data: string): deflate.Decompressor

Adds the compressed string to the stream.

Input is decoded in parts of at least 32768 bytes, the decompressor is reset on malformed data.

Throws an error on malformed data; call via pcall() when processing untrusted input.

Parameters
NameTypeDescription
compressed_datastringThe next part of the DEFLATE stream.
Returns
TypeNameDescription
deflate.Decompressorself

Subclasses

gzip.Decompressor, zlib.Decompressor

Generated from the dreamwork meta branch.