fn decodeFrame(dest: []u8, src: []const u8, verify_checksum: bool) error{BadMagic, UnknownContentSizeUnsupported, ContentTooLarge, ContentSizeTooLarge, WindowSizeUnknown, DictionaryIdFlagUnsupported, SkippableSizeTooLarge} || FrameError!ReadWriteCount

Decodes the frame at the start of src into dest. Returns the number of bytes read from src and written to dest. This function can only decode frames that declare the decompressed content size.

Errors returned:

  • error.BadMagic if the first 4 bytes of src is not a valid magic number for a Zstandard or skippable frame
  • error.UnknownContentSizeUnsupported if the frame does not declare the uncompressed content size
  • error.WindowSizeUnknown if the frame does not have a valid window size
  • error.ContentTooLarge if dest is smaller than the uncompressed data size declared by the frame header
  • error.ContentSizeTooLarge if the frame header indicates a content size that is larger than std.math.maxInt(usize)
  • error.DictionaryIdFlagUnsupported if the frame uses a dictionary
  • error.ChecksumFailure if verify_checksum is true and the frame contains a checksum that does not match the checksum of the decompressed data
  • error.ReservedBitSet if any of the reserved bits of the frame header are set
  • error.EndOfStream if src does not contain a complete frame
  • error.BadContentSize if the content size declared by the frame does not equal the actual size of decompressed data
  • an error in block.Error if there are errors decoding a block
  • error.SkippableSizeTooLarge if the frame is skippable and reports a size greater than src.len

Parameters

dest: []u8,
src: []const u8,
verify_checksum: bool,