pub struct Decompress { /* private fields */ }Expand description
Representation of an in-memory decompression stream.
An instance of Decompress can be used to decompress a stream of bz2-encoded
data.
Implementations§
Source§impl Decompress
impl Decompress
Sourcepub fn new(small: bool) -> Self
pub fn new(small: bool) -> Self
Creates a new stream prepared for decompression.
If small is true, then the library will use an alternative
decompression algorithm which uses less memory but at the cost of
decompressing more slowly (roughly speaking, half the speed, but the
maximum memory requirement drops to around 2300k).
Sourcepub fn decompress(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<Status, Error>
pub fn decompress( &mut self, input: &[u8], output: &mut [u8], ) -> Result<Status, Error>
Decompress a block of input into a block of output.
Sourcepub fn decompress_uninit(
&mut self,
input: &[u8],
output: &mut [MaybeUninit<u8>],
) -> Result<Status, Error>
pub fn decompress_uninit( &mut self, input: &[u8], output: &mut [MaybeUninit<u8>], ) -> Result<Status, Error>
Same as Self::decompress but accepts an uninitialized buffer.
Sourcepub fn decompress_vec(
&mut self,
input: &[u8],
output: &mut Vec<u8>,
) -> Result<Status, Error>
pub fn decompress_vec( &mut self, input: &[u8], output: &mut Vec<u8>, ) -> Result<Status, Error>
Decompress a block of input into an output vector.
This function will not grow output, but it will fill the space after
its current length up to its capacity. The length of the vector will be
adjusted appropriately.