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

#209 in Compression

Download history 25/week @ 2022-03-11 34/week @ 2022-03-18 8/week @ 2022-03-25 9/week @ 2022-04-01 11/week @ 2022-04-08 10/week @ 2022-04-15 13/week @ 2022-04-22 40/week @ 2022-04-29 40/week @ 2022-05-06 115/week @ 2022-05-13 27/week @ 2022-05-20 53/week @ 2022-05-27 50/week @ 2022-06-03 10/week @ 2022-06-10 39/week @ 2022-06-17 19/week @ 2022-06-24

126 downloads per month
Used in 2 crates

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),
		}
	}
}

lib.rs:

LZMA handling library.

Dependencies

~165KB