You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
345 B
13 lines
345 B
extern crate flate2;
|
|
|
|
use flate2::write::GzEncoder;
|
|
use flate2::Compression;
|
|
use std::io::prelude::*;
|
|
|
|
// Vec<u8> implements Write to print the compressed bytes of sample string
|
|
fn main() {
|
|
let mut e = GzEncoder::new(Vec::new(), Compression::default());
|
|
e.write_all(b"Hello World").unwrap();
|
|
println!("{:?}", e.finish().unwrap());
|
|
}
|