Module libflate::non_blocking::gzip [−][src]
The encoder and decoder of the GZIP format.
The GZIP format is defined in RFC-1952.
Examples
use std::io::{self, Read}; use libflate::gzip::Encoder; use libflate::non_blocking::gzip::Decoder; // Encoding let mut encoder = Encoder::new(Vec::new()).unwrap(); io::copy(&mut &b"Hello World!"[..], &mut encoder).unwrap(); let encoded_data = encoder.finish().into_result().unwrap(); // Decoding let mut decoder = Decoder::new(&encoded_data[..]); let mut decoded_data = Vec::new(); decoder.read_to_end(&mut decoded_data).unwrap(); assert_eq!(decoded_data, b"Hello World!");
Structs
Decoder | GZIP decoder which supports non-blocking I/O. |