6 releases

Uses old Rust 2015

0.2.2 Apr 9, 2016
0.2.1 Aug 3, 2015
0.2.0 Jul 29, 2015
0.1.1 Jul 25, 2015

#949 in Compression

Download history 182/week @ 2025-10-01 226/week @ 2025-10-08 159/week @ 2025-10-15 156/week @ 2025-10-22 92/week @ 2025-10-29 176/week @ 2025-11-05 106/week @ 2025-11-12 108/week @ 2025-11-19 118/week @ 2025-11-26 382/week @ 2025-12-03 457/week @ 2025-12-10 151/week @ 2025-12-17 164/week @ 2025-12-24 181/week @ 2025-12-31 162/week @ 2026-01-07 222/week @ 2026-01-14

749 downloads per month
Used in 6 crates (4 directly)

WTFPL license

27KB
797 lines

LZMA

Build Status

LZMA handling library.

[dependencies]
lzma = "*"

Example

This example will print the contents of the decoded LZMA file to stdout.

use std::io::{self, Read, Write};
use std::env;
use std::process;

extern crate lzma;

fn main() {
	let mut decoder = lzma::open(&env::args().nth(1).expect("missing file")).unwrap();
	let mut buffer  = [0u8; 4096];
	let mut stdout  = io::stdout();

	loop {
		match decoder.read(&mut buffer) {
			Ok(0) =>
				break,

			Ok(n) =>
				stdout.write_all(&buffer[0..n]).unwrap(),

			Err(_) =>
				process::exit(1),
		}
	}
}

Dependencies

~165KB