Function lz4::block::compress_to_buffer
source · pub fn compress_to_buffer(
src: &[u8],
mode: Option<CompressionMode>,
prepend_size: bool,
buffer: &mut [u8],
) -> Result<usize>
Expand description
Compresses the full src
buffer using the specified CompressionMode, where None and Some(Default)
are treated equally, writing compressed bytes to buffer
.
§Errors
Returns std::io::Error with ErrorKind::InvalidInput if the src buffer is too long.
The buffer cannot be larger than i32::MAX
.
Returns std::io::Error with ErrorKind::Other if the compression data does not fit in buffer
.