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

#626 in Compression

Download history 40/week @ 2024-03-13 45/week @ 2024-03-20 55/week @ 2024-03-27 57/week @ 2024-04-03 43/week @ 2024-04-10 44/week @ 2024-04-17 62/week @ 2024-04-24 47/week @ 2024-05-01 55/week @ 2024-05-08 61/week @ 2024-05-15 58/week @ 2024-05-22 60/week @ 2024-05-29 44/week @ 2024-06-05 40/week @ 2024-06-12 97/week @ 2024-06-19 40/week @ 2024-06-26

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

lib.rs:

LZMA handling library.

Dependencies

~165KB