pub fn uncompress_data<R, W>(source: R, target: W) -> Result<usize>
where
    R: Read,
    W: Write,
{
    let _utf8_guard = ffi::UTF8LocaleGuard::new();
    run_with_unseekable_archive(source, |archive_reader, _, mut entry| unsafe {
        archive_result(
            ffi::archive_read_next_header(archive_reader, &mut entry),
            archive_reader,
        )?;
        libarchive_write_data_block(archive_reader, target)
    })
}
/// Uncompress a file using the `source` need as reader and the `target` as a
/// writer.
///
/// # Example
///
/// ```no_run
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// 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)?;
/// # Ok(())
/// # }
/// ```
///
/// Slices can be used if you know the exact length of the uncompressed data.
/// ```no_run
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// 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])?;
/// # Ok(())
/// # }
/// ```
Uncompress a file using the `source` need as reader and the `target` as a
writer.
Uncompress a file using the ` source ` need as reader and the ` target ` as a writer .
pub fn uncompress_data<R, W>(source: R, target: W) -> Result<usize>
where
    R: Read,
    W: Write,
{
    let _utf8_guard = ffi::UTF8LocaleGuard::new();
    run_with_unseekable_archive(source, |archive_reader, _, mut entry| unsafe {
        archive_result(
            ffi::archive_read_next_header(archive_reader, &mut entry),
            archive_reader,
        )?;
        libarchive_write_data_block(archive_reader, target)
    })
}
pub fn uncompress_data < R , W > ( source : R , target : W ) -> Result < usize > where R : Read , W : Write , { let _utf8_guard = ffi :: UTF8LocaleGuard :: new ( ) ; run_with_unseekable_archive ( source , | archive_reader , _ , mut entry | unsafe { archive_result ( ffi :: archive_read_next_header ( archive_reader , & mut entry ) , archive_reader , ) ? ; libarchive_write_data_block ( archive_reader , target ) } ) }
Uncompress a file using the `source` need as reader and the `target` as a
writer.
Uncompress a file using the ` source ` need as reader and the ` target ` as a writer .
source
R
target
W
source
R
target
W
example
None
fn main() -> result<(), box<dyn std::error::error>> {
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)?.
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 ) ? .
ok(())
None
}


Slices can be used if you know the exact length of the uncompressed data.
Slices can be used if you know the exact length of the uncompressed data .
fn main() -> result<(), box<dyn std::error::error>> {
use compress_tools::*;
use std::fs::File.

let mut source = File::open("file.txt.gz")?;
let mut target = [0 as u8; 313].


use compress_tools :: * ; use std :: fs :: File . let mut source = File :: open ( " file . txt . gz " ) ? ; let mut target = [ 0 as u8 ; 313 ] .
ok(())
None
}
None