Module libflate::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, 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 | GZIP decoder. |
EncodeOptions | Options for a GZIP encoder. |
Encoder | GZIP encoder. |
ExtraField | Extra field of a GZIP header. |
ExtraSubField | A sub field in the extra field of a GZIP header. |
Header | GZIP Header. |
HeaderBuilder | GZIP header builder. |
MultiDecoder | A decoder that decodes all members in a GZIP stream. |
Enums
CompressionLevel | Compression levels defined by the GZIP format. |
Os | OS type. |