[][src]Function deflate::deflate_bytes_gzip_conf

pub fn deflate_bytes_gzip_conf<O: Into<CompressionOptions>>(
    input: &[u8],
    options: O,
    gzip_header: GzBuilder
) -> Vec<u8>

Compress the given slice of bytes with DEFLATE compression, including a gzip header and trailer using the given gzip header and compression options.

Returns a Vec<u8> of the compressed data.


extern crate gzip_header;
extern crate deflate;

use deflate::{deflate_bytes_gzip_conf, Compression};
use gzip_header::GzBuilder;

let data = b"This is some test data";
let compressed_data = deflate_bytes_gzip_conf(data, Compression::Best, GzBuilder::new());