pub fn parallel_bzip2_cat<P: AsRef<Path>>(path: P) -> Result<Vec<u8>>Expand description
Decompresses an entire bzip2 file and returns the decompressed data.
This is a convenience function that combines scanning and decompression. It’s primarily used for testing but can be useful for simple use cases.
For more control or streaming decompression, use Bz2Decoder instead.
§Arguments
path- Path to the bzip2 file
§Returns
The complete decompressed file contents
§Errors
Returns an error if:
- The file cannot be opened
- The file is not a valid bzip2 file
- Decompression fails
§Examples
use parallel_bzip2_decoder::parallel_bzip2_cat;
let data = parallel_bzip2_cat("file.bz2").unwrap();
println!("Decompressed {} bytes", data.len());