Module zlib

Source
Expand description

ZLIB Compression and Decompression. Requires zlib feature, enabled by default

This module contains an implementation of the ZLIB compression scheme. This compression format is based on an underlying DEFLATE-encoded stream.

§Example

use compress::zlib;
use std::fs::File;
use std::path::Path;
use std::io::Read;

let stream = File::open(&Path::new("path/to/file.zlib")).unwrap();
let mut decompressed = Vec::new();
zlib::Decoder::new(stream).read_to_end(&mut decompressed);
  • http://tools.ietf.org/html/rfc1950 - RFC that this implementation is based on

Structs§

Decoder
Structure used to decode a ZLIB-encoded stream. The wrapped stream can be re-acquired through the unwrap() method.