fn decodeZstandardFrame(dest: []u8, src: []const u8, verify_checksum: bool) error{UnknownContentSizeUnsupported, ContentTooLarge, ContentSizeTooLarge, WindowSizeUnknown, DictionaryIdFlagUnsupported} || FrameError!ReadWriteCount
[src]
Decode a Zstandard frame from src
into dest
, returning the number of bytes read from src
and written to dest
. The first four bytes of src
must be the magic number for a Zstandard frame.
Error returned:
error.UnknownContentSizeUnsupported
if the frame does not declare the uncompressed content sizeerror.ContentTooLarge
ifdest
is smaller than the uncompressed data size declared by the frame headererror.WindowSizeUnknown
if the frame does not have a valid window sizeerror.DictionaryIdFlagUnsupported
if the frame uses a dictionaryerror.ContentSizeTooLarge
if the frame header indicates a content size that is larger thanstd.math.maxInt(usize)
error.ChecksumFailure
ifverify_checksum
is true and the frame contains a checksum that does not match the checksum of the decompressed dataerror.ReservedBitSet
if the reserved bit of the frame header is seterror.EndOfStream
ifsrc
does not contain a complete frame- an error in
block.Error
if there are errors decoding a block error.BadContentSize
if the content size declared by the frame does not equal the actual size of decompressed data