Expand description
Streaming decompression functionality.
Modulesยง
- inflate_
flags - Flags to
decompress()
to control how inflation works.
Macrosยง
- generate_
state ๐
Structsยง
- Decompressor
Oxide - Main decompression struct.
- Huffman
Table ๐ - A struct containing huffman code lengths and the huffman code tree used by the decompressor.
- Local
Vars ๐
Enumsยง
Constantsยง
- BASE_
EXTRA_ ๐MASK - The mask used when indexing the base/extra arrays.
- DIST_
BASE ๐ - Base length for each distance code.
- DIST_
TABLE ๐ - FAST_
LOOKUP_ ๐BITS - The maximum length of a code that can be looked up in the fast lookup table.
- FAST_
LOOKUP_ ๐SIZE - The size of the fast lookup table.
- HUFFLEN_
TABLE ๐ - LENGTH_
BASE ๐ - Base length for each length code.
- LENGTH_
EXTRA ๐ - Number of extra bits for each length code.
- LEN_
CODES_ ๐MASK - LEN_
CODES_ ๐SIZE - LITLEN_
TABLE ๐ - MAX_
HUFF_ ๐SYMBOLS_ 0 - The length of the first (literal/length) huffman table.
- MAX_
HUFF_ ๐SYMBOLS_ 1 - The length of the second (distance) huffman table.
- MAX_
HUFF_ ๐SYMBOLS_ 2 - The length of the last (huffman code length) huffman table.
- MAX_
HUFF_ ๐TABLES - The number of huffman tables used.
- MAX_
HUFF_ ๐TREE_ SIZE - MIN_
TABLE_ ๐SIZES - TINFL_
LZ_ DICT_ SIZE
Functionsยง
- apply_
match ๐ - Presumes that there is at least match_len bytes in output left.
- decode_
huffman_ ๐code - Try to decode the next huffman code, and puts it in the counter field of the decompressor if successful.
- decompress
- Main decompression function. Keeps decompressing data from
in_buf
until thein_buf
is empty,out
is full, the end of the deflate stream is hit, or there is an error in the deflate stream. - decompress_
fast ๐ - Fast inner decompression loop which is run while there is at least 259 bytes left in the output buffer, and at least 6 bytes left in the input buffer (The maximum one match would need + 1).
- end_
of_ ๐input - fill_
bit_ ๐buffer - Ensure that there is data in the bit buffer.
- init_
tree ๐ - num_
extra_ ๐bits_ for_ distance_ code - Get the number of extra bits used for a distance code.
(Code numbers above
NUM_DISTANCE_CODES
will give some garbage value.) - pad_
to_ ๐bytes - read_
bits ๐ - Try to read
amount
number of bits fromin_iter
and call the functionf
with the bits as an an argument after reading, returning the result of that function, orAction::End
if there are not enough bytes left. - read_
byte ๐ - Try to read one byte from
in_iter
and callf
with the read byte as an argument, returning the result. If reading fails,Action::End is returned
- read_
u16_ ๐le - Read an le u16 value from the slice iterator.
- reverse_
bits ๐ - start_
static_ ๐table - transfer ๐
- undo_
bytes ๐ - validate_
zlib_ ๐header - Check that the zlib header is correct and that there is enough space in the buffer for the window size specified in the header.
Type Aliasesยง
- BitBuffer ๐