Struct flate2::bufread::DeflateDecoder
[−]
[src]
pub struct DeflateDecoder<R: BufRead> { // some fields omitted }
A DEFLATE decoder, or decompressor.
This structure implements a BufRead
interface and takes a stream of
compressed data as input, providing the decompressed data when read from.
Methods
impl<R: BufRead> DecoderReaderBuf<R>
fn new(r: R) -> DecoderReaderBuf<R>
Creates a new decoder which will decompress data read from the given stream.
fn reset(&mut self, r: R) -> R
Resets the state of this decoder entirely, swapping out the input stream for another.
This will reset the internal state of this decoder and replace the
input stream with the one provided, returning the previous input
stream. Future data read from this decoder will be the decompressed
version of r
's data.
fn get_ref(&self) -> &R
Acquires a reference to the underlying stream
fn get_mut(&mut self) -> &mut R
Acquires a mutable reference to the underlying stream
Note that mutation of the stream may result in surprising results if this encoder is continued to be used.
fn into_inner(self) -> R
Consumes this decoder, returning the underlying reader.
fn total_in(&self) -> u64
Returns the number of bytes that the decompressor has consumed.
Note that this will likely be smaller than what the decompressor actually read from the underlying stream due to buffering.
fn total_out(&self) -> u64
Returns the number of bytes that the decompressor has produced.