Module libflate::zlib [−][src]
The encoder and decoder of the ZLIB format.
The ZLIB format is defined in RFC-1950.
Examples
use std::io::{self, Read}; use libflate::zlib::{Encoder, 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[..]).unwrap(); let mut decoded_data = Vec::new(); decoder.read_to_end(&mut decoded_data).unwrap(); assert_eq!(decoded_data, b"Hello World!");
Structs
Decoder | ZLIB decoder. |
EncodeOptions | Options for a ZLIB encoder. |
Encoder | ZLIB encoder. |
Header | ZLIB header. |
Enums
CompressionLevel | Compression levels defined by the ZLIB format. |
Lz77WindowSize | LZ77 Window sizes defined by the ZLIB format. |