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

#477 in Compression

Download history 48/week @ 2023-10-31 47/week @ 2023-11-07 36/week @ 2023-11-14 50/week @ 2023-11-21 63/week @ 2023-11-28 28/week @ 2023-12-05 39/week @ 2023-12-12 65/week @ 2023-12-19 61/week @ 2023-12-26 39/week @ 2024-01-02 46/week @ 2024-01-09 58/week @ 2024-01-16 35/week @ 2024-01-23 53/week @ 2024-01-30 70/week @ 2024-02-06 79/week @ 2024-02-13

251 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