minilz4

Crates.iominilz4
lib.rsminilz4
version0.6.1
sourcesrc
created_at2020-04-15 09:48:54.385282
updated_at2023-05-19 10:36:33.697409
descriptionMinimal interface for the LZ4 compression library frame format
homepage
repositoryhttps://github.com/Systemcluster/minilz4
max_upload_size
id230432
size492,491
Chris (Systemcluster)

documentation

README

minilz4

Crates.io Docs.rs

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();
Commit count: 29

cargo fmt