Expand description
LZ4 compression and decompression.
LZ4: Extremely fast compression algorithm.
§Acceleration factor
Some functions take the acceleration factor.
Larger value increases the processing speed in exchange for the lesser compression ratio.
// The default factor is 1 so both have the same meaning.
lz4::compress_to_vec(data, &mut buf, lz4::ACC_LEVEL_DEFAULT)?;
lz4::compress_to_vec(data, &mut buf, 1)?;
// Factors lower than 1 are interpreted as 1 so these are also the same as above.
lz4::compress_to_vec(data, &mut buf, 0)?;
lz4::compress_to_vec(data, &mut buf, -100)?;
// Faster but less effective compression.
lz4::compress_to_vec(data, &mut buf, 1000)?;
Structs§
- Compressor
- Streaming LZ4 compressor.
- Decompressor
- Streaming LZ4 decompressor.
Constants§
- ACC_
LEVEL_ DEFAULT - Predefined acceleration level (1).
Functions§
- compress
- Performs LZ4 block compression.
- compress_
fill - Compress data to fill
dst
. - compress_
to_ vec - Appends compressed data to
Vec<u8>
. - decompress
- Decompresses an LZ4 block.
- decompress_
partial - Decompresses an LZ4 block until the destination slice fills up.
- decompress_
partial_ with_ dict - Decompresses an LZ4 block with a dictionary until the destination slice fills up.
- decompress_
with_ dict - Decompresses an LZ4 block with a dictionary.
- max_
compressed_ size - Calculates the maximum size of the compressed output.