Struct inflate::InflateStream
[−]
[src]
pub struct InflateStream { /* fields omitted */ }
Methods
impl InflateStream
[src]
fn new() -> InflateStream
Create a new stream for decoding raw deflate encoded data.
fn from_zlib() -> InflateStream
Create a new stream for decoding deflate encoded data with a zlib header and footer
fn update<'a>(&'a mut self, data: &[u8]) -> Result<(usize, &'a [u8]), String>
Try to uncompress/decode the data in data
.
On success, returns how many bytes of the input data was decompressed, and a reference to the buffer containing the decompressed data.
This function may not uncompress all the provided data in one call, so it has to be called repeatedly with the data that hasn't been decompressed yet as an input until the number of bytes decoded returned is 0. (See the top level crate documentation for an example.)
Errors
If invalid input data is encountered, a string describing what went wrong is returned.