deflate.Decompressor
Object → deflate.Decompressor with deflate.InflateStream
The DEFLATE stream decompressor object.
Constructor
deflate.Decompressor(dictionary: string?): deflate.DecompressorMethods
flush | Decodes all input and returns the decompressed data. |
reset | Drops all input and output, the next update starts a new stream with the same dictionary. |
update | Adds the compressed string to the stream. |
#Decompressor:flush
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
| Type | Name | Description |
|---|---|---|
string | decompressed_data | The decompressed string. |
string | remaining_data | The data after the end of the stream (like the zlib or gzip trailer). |
#Decompressor:reset
function deflate.Decompressor:reset(): deflate.Decompressor
Drops all input and output, the next update starts a new stream with the same dictionary.
Returns
| Type | Name | Description |
|---|---|---|
deflate.Decompressor | self |
#Decompressor:update
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
| Name | Type | Description |
|---|---|---|
compressed_data | string | The next part of the DEFLATE stream. |
Returns
| Type | Name | Description |
|---|---|---|
deflate.Decompressor | self |