InflateError

Error codes for DEFLATE / gzip inflation, a direct port of the numeric return values of libtorrent's puff() (src/puff.cpp) and the matching gzip_errors::error_code_enum (include/libtorrent/gzip.hpp).

The integer code is exactly the value puff() returns (plus two gzip-level codes that puff() itself never produces), so anyone cross-referencing the C++ source can map an exception straight back to the original branch. The message strings are copied verbatim from gzip_error_category::message (src/gzip.cpp) so behaviour matches libtorrent's diagnostics.

Note on numbering: libtorrent's gzip_error_category re-maps puff's negative codes onto a positive enum (its inflate_gzip switch turns puff -1..-11 into invalid_block_type .. distance_too_far_back_in_block). Here we keep puff's own signed codes because they're the ground truth of the algorithm; the human-readable text is what libtorrent shows to callers.

Entries

Link copied to clipboard

puff 2: bits()/decode() ran off the end of the input (longjmp path).

Link copied to clipboard

puff 1: only reachable with a bounded output buffer; we grow instead.

Link copied to clipboard

puff -1: block type field was 3 (reserved).

Link copied to clipboard

puff -2: stored block LEN did not match ~LEN.

Link copied to clipboard

puff -3: dynamic header declared more codes than the format allows.

Link copied to clipboard

puff -4: the code-length code itself was not a complete set.

Link copied to clipboard

puff -5: a repeat-previous (16) instruction with no previous length.

Link copied to clipboard

puff -6: a run-length instruction overran the declared symbol count.

Link copied to clipboard

puff -7: literal/length code lengths formed an invalid (over/incomplete) set.

Link copied to clipboard

puff -8: distance code lengths formed an invalid set.

Link copied to clipboard

puff -9: the dynamic block had no end-of-block symbol.

Link copied to clipboard

puff -10: the decoder hit an invalid Huffman code in a fixed/dynamic block.

Link copied to clipboard

puff -11: a back-reference distance pointed before the start of output.

Link copied to clipboard

gzip-level: the gzip header magic/method/flags were malformed.

Link copied to clipboard

gzip-level: inflated output would exceed the caller-supplied maximum.

Link copied to clipboard

Catch-all, matching libtorrent's unknown_gzip_error.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val code: Int
Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.