Struct lzzzz::lz4_hc::Compressor
source · [−]pub struct Compressor<'a> { /* private fields */ }
Expand description
Streaming LZ4_HC compressor.
Example
use lzzzz::{lz4, lz4_hc};
let data = b"The quick brown fox jumps over the lazy dog.";
let mut buf = [0u8; 256];
// The slice should have enough capacity.
assert!(buf.len() >= lz4::max_compressed_size(data.len()));
let mut comp = lz4_hc::Compressor::new()?;
let len = comp.next(data, &mut buf)?;
let compressed = &buf[..len];
Implementations
Creates a new Compressor
with a dictionary.
Sets the compression level.
Sets the decompression speed mode flag.
Performs LZ4_HC streaming compression.
Returns the number of bytes written into the destination buffer.
Compresses data until the destination slice fills up.
Returns the number of bytes written into the destination buffer.