[−][src]Function lzzzz::lz4_hc::compress_partial
pub fn compress_partial(
src: &[u8],
dst: &mut [u8],
level: i32
) -> Result<(usize, usize)>
Compresses data until the destination slice fills up.
The first usize
of the returned value represents the number of bytes written into the
destination buffer, and the other represents the number of bytes read from the source buffer.
Example
use lzzzz::{lz4, lz4_hc}; let data = b"The quick brown fox jumps over the lazy dog."; let mut buf = [0u8; 16]; let (src_len, dst_len) = lz4_hc::compress_partial(data, &mut buf, lz4_hc::CLEVEL_DEFAULT)?; let compressed = &buf[..dst_len];