gzip.Decompressor
The gzip stream decompressor object.
Constructor
deflate.Decompressor(): gzip.DecompressorMethods
flush | Decodes all input, checks the checksum and the size, and returns the decompressed data. |
flush | Decodes all input and returns the decompressed data. |
reset | Drops all input and output, the next update starts a new stream. |
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. |
update | Adds the compressed string to the stream. |
#Decompressor:flush
function gzip.Decompressor:flush(): string, string, gzip.Header
Decodes all input, checks the checksum and the size, and returns the decompressed data.
Concatenated gzip members are decompressed into one string, like gzip.decompress does, the members after the first one are decoded here at once.
The stream is reset after this, so the decompressor can be used for the next stream.
Throws an error on malformed or truncated data, or if the checksum or the size does not match; call via pcall() when processing untrusted input.
| Type | Name | Description |
|---|---|---|
string | decompressed_data | The decompressed string. |
string | remaining_data | The data after the end of the stream. |
gzip.Header | header | The header of the first member. |
#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.
| 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 gzip.Decompressor:reset(): gzip.Decompressor
Drops all input and output, the next update starts a new stream.
| Type | Name | Description |
|---|---|---|
gzip.Decompressor | self |
#Decompressor:reset
function deflate.Decompressor:reset(): deflate.Decompressor
Drops all input and output, the next update starts a new stream with the same dictionary.
| Type | Name | Description |
|---|---|---|
deflate.Decompressor | self |
#Decompressor:update
function gzip.Decompressor:update(compressed_data: string): gzip.Decompressor
Adds the compressed string to the stream.
Throws an error on malformed data and resets the decompressor; call via pcall() when processing untrusted input.
| Name | Type | Description |
|---|---|---|
compressed_data | string | The next part of the gzip stream. |
| Type | Name | Description |
|---|---|---|
gzip.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.
| Name | Type | Description |
|---|---|---|
compressed_data | string | The next part of the DEFLATE stream. |
| Type | Name | Description |
|---|---|---|
deflate.Decompressor | self |