Function zstd_sys::ZSTD_decompressBound
source · pub unsafe extern "C" fn ZSTD_decompressBound(
src: *const c_void,
srcSize: usize,
) -> c_ulonglong
Expand description
ZSTD_decompressBound() :
src
should point to the start of a series of ZSTD encoded and/or skippable frames
srcSize
must be the exact size of this series
(i.e. there should be a frame boundary at src + srcSize
)
@return : - upper-bound for the decompressed size of all data in all successive frames
- if an error occurred: ZSTD_CONTENTSIZE_ERROR
note 1 : an error can occur if src
contains an invalid or incorrectly formatted frame.
note 2 : the upper-bound is exact when the decompressed size field is available in every ZSTD encoded frame of src
.
in this case, ZSTD_findDecompressedSize
and ZSTD_decompressBound
return the same value.
note 3 : when the decompressed size field isn’t available, the upper-bound for that frame is calculated by:
upper-bound = # blocks * min(128 KB, Window_Size)