Skip to main content

frame_decompressed_bound

Function frame_decompressed_bound 

Source
pub fn frame_decompressed_bound(src: &[u8]) -> Result<u64, FrameSizeError>
Expand description

Upper bound on the decompressed size of the FIRST frame in src, without decoding the body. Backs the C ZSTD_decompressBound (per-frame term).

Returns the exact size when the header declares Frame_Content_Size; otherwise a valid (loose) bound of block_count * block_size_max, where block_size_max = min(window_size, 128 KiB) — every block decompresses to at most that many bytes. Skippable frames contribute 0.

§Errors

FrameSizeError on an unreadable header, truncation, or a reserved block.