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

#665 in Compression

Download history 52/week @ 2024-07-19 61/week @ 2024-07-26 55/week @ 2024-08-02 56/week @ 2024-08-09 41/week @ 2024-08-16 51/week @ 2024-08-23 57/week @ 2024-08-30 40/week @ 2024-09-06 32/week @ 2024-09-13 66/week @ 2024-09-20 75/week @ 2024-09-27 33/week @ 2024-10-04 37/week @ 2024-10-11 48/week @ 2024-10-18 44/week @ 2024-10-25 46/week @ 2024-11-01

178 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