Struct inflate::InflateStream
source · pub struct InflateStream { /* private fields */ }
Implementations§
source§impl InflateStream
impl InflateStream
sourcepub fn new() -> InflateStream
pub fn new() -> InflateStream
Create a new stream for decoding raw deflate encoded data.
sourcepub fn from_zlib() -> InflateStream
pub fn from_zlib() -> InflateStream
Create a new stream for decoding deflate encoded data with a zlib header and footer
sourcepub fn from_zlib_no_checksum() -> InflateStream
pub fn from_zlib_no_checksum() -> InflateStream
Create a new stream for decoding deflate encoded data with a zlib header and footer
This version creates a decoder that does not checksum the data to validate it with the checksum provided with the zlib wrapper.
pub fn reset(&mut self)
pub fn reset_to_zlib(&mut self)
sourcepub fn update<'a>(
&'a mut self,
data: &[u8],
) -> Result<(usize, &'a [u8]), String>
pub 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.
sourcepub fn current_checksum(&self) -> u32
pub fn current_checksum(&self) -> u32
Returns the calculated checksum value of the currently decoded data.
Will return 0 for cases where the checksum is not validated.