Function compress_tools::uncompress_data [−][src]
pub fn uncompress_data<R, W>(source: R, target: W) -> Result<usize> where
R: Read,
W: Write,
Expand description
Uncompress a file using the source
need as reader and the target
as a
writer.
Example
use compress_tools::*; use std::fs::File; let mut source = File::open("file.txt.gz")?; let mut target = Vec::default(); uncompress_data(&mut source, &mut target)?;
Slices can be used if you know the exact length of the uncompressed data.
use compress_tools::*; use std::fs::File; let mut source = File::open("file.txt.gz")?; let mut target = [0 as u8; 313]; uncompress_data(&mut source, &mut target as &mut [u8])?;