snap 1.1.1

A pure Rust implementation of the Snappy compression algorithm. Includes streaming compression and decompression.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use snap;

use std::io;

fn main() {
    let stdin = io::stdin();
    let stdout = io::stdout();

    // Wrap the stdin reader in a Snappy reader.
    let mut rdr = snap::read::FrameDecoder::new(stdin.lock());
    let mut wtr = stdout.lock();
    io::copy(&mut rdr, &mut wtr).expect("I/O operation failed");
}