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. Returns std::io::Error with ErrorKind::Other if the compression data does not find in buffer.