Popularity
2.4
Growing
Activity
0.0
Stable
66
4
15

Description

This crate provides a simple interface to liblzma. LZMA is more commonly known as XZ or 7zip, (as in, files with the .xz or .7z file extension). LZMA compression is fast and aggressive, compressing better than bzip2. liblzma implements the XZ variant, so it can read and write .xz files/streams.

Two interfaces are provided. LzmaReader/LzmaWriter are generic Readers and Writers that can be composed with other Read/Write interfaces. For example, wrap them around a File and you can write data to a file while compressing it on the fly, or stream in an xz file from disk.

See the documentation for details on usage.

Programming language: Rust
License: MIT License
Tags: Compression     decompression     LZMA     Xz     Liblzma    
Latest version: v0.3.0

rust-lzma alternatives and similar packages

Based on the "Compression" category.
Alternatively, view rust-lzma alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of rust-lzma or a related project?

Add another 'Compression' Package

README

rust-lzma Build Status Crates.io

Documentation

This crate provides a simple interface to liblzma. LZMA is more commonly known as XZ or 7zip, (as in, files with the .xz or .7z file extension). LZMA compression is fast and aggressive, compressing better than bzip2. liblzma implements the XZ variant, so it can read and write .xz files/streams.

Two interfaces are provided. LzmaReader/LzmaWriter are generic Readers and Writers that can be composed with other Read/Write interfaces. For example, wrap them around a File and you can write data to a file while compressing it on the fly, or stream in an xz file from disk.

compress/decompress are easy to use functions for simple use cases.

See the documentation for details on usage.

Example

Cargo.toml:

[dependencies]
rust-lzma = "0.5"

main.rs:

extern crate lzma;

use lzma::LzmaWriter;
use std::io::prelude::*;
use std::fs::File;

fn main() {
    let f = File::create("foo.xz").unwrap();
    let mut f = LzmaWriter::new_compressor(f, 6).unwrap();

    write!(f, "It's a small world!").unwrap();
    f.finish().unwrap();
}