Expand description
The encoder and decoder of the GZIP format.
The GZIP format is defined in RFC-1952.
§Examples
#[cfg(feature = "no_std")]
use core2::io::{Read, Write};
#[cfg(not(feature = "no_std"))]
use std::io::{Read, Write};
use libflate::gzip::{Encoder, Decoder};
// Encoding
let mut encoder = Encoder::new(Vec::new()).unwrap();
encoder.write_all(b"Hello World!".as_ref()).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§
- GZIP decoder.
- Options for a GZIP encoder.
- GZIP encoder.
- Extra field of a GZIP header.
- A sub field in the extra field of a GZIP header.
- GZIP Header.
- GZIP header builder.
- A decoder that decodes all members in a GZIP stream.
Enums§
- Compression levels defined by the GZIP format.
- OS type.