fn decodeBlock(dest: []u8, src: []const u8, block_header: frame.Zstandard.Block.Header, decode_state: *DecodeState, consumed_count: *usize, block_size_max: usize, written_count: usize) error{DestTooSmall} || Error!usize

Decode a single block from src into dest. The beginning of src must be the start of the block content (i.e. directly after the block header). Increments consumed_count by the number of bytes read from src to decode the block and returns the decompressed size of the block.

Errors returned:

  • error.BlockSizeOverMaximum if block’s size is larger than 1 << 17 or dest[written_count..].len
  • error.MalformedBlockSize if src.len is smaller than the block size and the block is a raw or compressed block
  • error.ReservedBlock if the block is a reserved block
  • error.MalformedRleBlock if the block is an RLE block and src.len < 1
  • error.MalformedCompressedBlock if there are errors decoding a compressed block
  • error.DestTooSmall is dest is not large enough to hold the decompressed block

Parameters

dest: []u8,
src: []const u8,
block_header: frame.Zstandard.Block.Header,
decode_state: *DecodeState,
consumed_count: *usize,
block_size_max: usize,
written_count: usize,