Struct brotli::Decompressor
[−]
[src]
pub struct Decompressor<R: Read> { // some fields omitted }
Wraps an input stream and provides methods for decompressing.
Examples
use std::io::{ Read, stdout, Write }; use brotli::Decompressor; let brotli_stream = std::fs::File::open("data/64x.compressed").unwrap(); let mut decompressed = &mut Vec::new(); let _ = Decompressor::new(brotli_stream).read_to_end(&mut decompressed); let mut expected = &mut Vec::new(); let _ = std::fs::File::open("data/64x").unwrap().read_to_end(&mut expected); assert_eq!(expected, decompressed); stdout().write_all(decompressed).ok();
Methods
impl<R: Read> Decompressor<R>
fn new(r: R) -> Decompressor<R>
Creates Decompressor from Read.