Module libflate::gzip[][src]

Expand description

The encoder and decoder of the GZIP format.

The GZIP format is defined in RFC-1952.


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!");


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.


Compression levels defined by the GZIP format.

OS type.