Struct flate2::write::DeflateEncoder
[-] [+]
[src]
pub struct DeflateEncoder<W: Write> { // some fields omitted }
A DEFLATE encoder, or compressor.
This structure implements a Write
interface and takes a stream of
uncompressed data, writing the compressed data to the wrapped writer.
Methods
impl<W: Write> EncoderWriter<W>
fn new(w: W, level: Compression) -> EncoderWriter<W>
Creates a new encoder which will write compressed data to the stream given at the given compression level.
When this encoder is dropped or unwrapped the final pieces of data will be flushed.
fn finish(self) -> Result<W>
Consumes this encoder, flushing the output stream.
This will flush the underlying data stream and then return the contained writer if the flush succeeded.