7 releases (breaking)
0.6.1 | May 19, 2023 |
---|---|
0.6.0 | Feb 2, 2023 |
0.5.0 | Feb 17, 2021 |
0.4.0 | Apr 22, 2020 |
0.1.0 | Apr 15, 2020 |
#453 in Compression
54 downloads per month
Used in staticfilemap
345KB
6.5K
SLoC
minilz4
Minimal interface for the LZ4 compression library frame format.
Links to LZ4 1.9.4.
Usage
Examples
Simple
use minilz4::{Encode, EncoderBuilder, Decode};
use std::io::Cursor;
let data = "Blushing is the color of virtue.";
let encoded = Cursor::new(data).encode(&EncoderBuilder::new()).unwrap();
let decoded = Cursor::new(encoded).decode().unwrap();
Read & Write Traits
use minilz4::{EncoderBuilder, Decoder};
use std::io::{Cursor, copy};
let data = "Blushing is the color of virtue.";
let mut encoder = EncoderBuilder::new().build(Vec::new()).unwrap();
copy(&mut Cursor::new(data.as_bytes()), &mut encoder).unwrap();
let encoded = encoder.finish().unwrap();
let mut decoder = Decoder::new(Cursor::new(encoded)).unwrap();
let mut decoded = Vec::new();
decoder.read_to_end(&mut decoded).unwrap();
Dependencies
~0.4–325KB