Skip to main content

decompress_with_limit

Function decompress_with_limit 

Source
pub fn decompress_with_limit(
    r: &mut DecompressorOxide,
    in_buf: &[u8],
    out: &mut [u8],
    out_pos: usize,
    out_max: usize,
    flags: u32,
) -> (TINFLStatus, usize, usize)
Expand description

Same as decompress() with a maximum decompressed byte count.

By default decompress() decompress untill end of out buffer if possible. decompress_with_limit will stop when out_max bytes have been decompressed, or when out buffer is full, whichever comes first.

This is especially useful when using a wrapping output buffer. This helps keeping some data that has not yet been consumed in the buffer while decompressing new bytes.

out_max is the maximum number of bytes that decompress will write