pub(super) struct ZlibStream {
state: Box<Decompressor>,
started: bool,
ignore_adler32: bool,
}Expand description
Ergonomics wrapper around miniz_oxide::inflate::stream for zlib compressed data.
Fields§
§state: Box<Decompressor>Current decoding state.
started: boolIf there has been a call to decompress already.
ignore_adler32: boolIgnore and do not calculate the Adler-32 checksum. Defaults to true.
This flag overrides TINFL_FLAG_COMPUTE_ADLER32.
This flag should not be modified after decompression has started.
Implementations§
Source§impl ZlibStream
impl ZlibStream
pub(crate) fn new() -> Self
pub(crate) fn reset(&mut self)
Sourcepub(crate) fn set_ignore_adler32(&mut self, flag: bool) -> bool
pub(crate) fn set_ignore_adler32(&mut self, flag: bool) -> bool
Set the ignore_adler32 flag and return true if the flag was
successfully set.
The default is true.
This flag cannot be modified after decompression has started until the ZlibStream is reset.
Sourcepub(crate) fn ignore_adler32(&self) -> bool
pub(crate) fn ignore_adler32(&self) -> bool
Return the ignore_adler32 flag.
Sourcepub(crate) fn decompress(
&mut self,
data: &[u8],
image_data: &mut UnfilterBuf<'_>,
) -> Result<usize, DecodingError>
pub(crate) fn decompress( &mut self, data: &[u8], image_data: &mut UnfilterBuf<'_>, ) -> Result<usize, DecodingError>
Fill the decoded buffer as far as possible from data.
On success returns the number of consumed input bytes.
Sourcepub(crate) fn finish(
&mut self,
image_data: &mut UnfilterBuf<'_>,
) -> Result<bool, DecodingError>
pub(crate) fn finish( &mut self, image_data: &mut UnfilterBuf<'_>, ) -> Result<bool, DecodingError>
Output any remaining buffered data within the decompressor.
Returns Ok(true) if all data has been decompressed and there is no
more data that will be produced, or Ok(false) if there’s potentially
more output.
Returns Err if the zlib stream is corrupt or truncated too early.