Skip to main content

compress_into_with_table

Function compress_into_with_table 

Source
pub fn compress_into_with_table(
    input: &[u8],
    output: &mut [u8],
    table: &mut CompressTable,
) -> Result<usize, CompressError>
Expand description

Compress all bytes of input into output, reusing a CompressTable to avoid re-allocating the internal hash table.

output should be preallocated with a size of get_maximum_output_size.

Returns the number of bytes written (compressed) into output.

Note: If the table variant doesn’t match the input size (e.g. a Small table is used with input >= 64KB), the table will be transparently upgraded. However, it won’t be downgraded automatically.