fn prepare(self: *DecodeState, source: anytype, literals: LiteralsSection, sequences_header: SequencesSection.Header) !void

Prepare the decoder to decode a compressed block. Loads the literals stream and Huffman tree from literals and reads the FSE tables from source.

Errors returned:

  • error.BitStreamHasNoStartBit if the (reversed) literal bitstream’s first byte does not have any bits set
  • error.TreelessLiteralsFirst literals is a treeless literals section and the decode state does not have a Huffman tree from a previous block
  • error.RepeatModeFirst on the first call if one of the sequence FSE tables is set to repeat mode
  • error.MalformedAccuracyLog if an FSE table has an invalid accuracy
  • error.MalformedFseTable if there are errors decoding an FSE table
  • error.EndOfStream if source ends before all FSE tables are read

Parameters

self: *DecodeState,
source: anytype,
literals: LiteralsSection,
sequences_header: SequencesSection.Header,