pub fn decompress<F: Format>(
reader: &mut (impl Read + Seek),
writer: &mut impl Write,
) -> Result<(), RefPackError>Expand description
Decompress refpack data. Accepts arbitrary Reads and Writes.
§Example
use std::io::Cursor;
let mut input = Cursor::new(/* some refpack data */);
let mut output = Cursor::new(Vec::new());
// decompress the input into the output
refpack::compress(&mut input, &mut output);
// output now contains the decompressed version of the input§Errors
- RefPackError::BadMagic: Header magic was malformed, likely indicating either uncompressed data or attempting to decompress data in an incorrect format
- RefPackError::BadFlags: Header magic was malformed, likely indicating either uncompressed data or attempting to decompress data in an incorrect format
- RefPackError::ControlError: Invalid control code operation was attempted to be performed. This normally indicated corrupted or invalid refpack data
- RefPackError::Io: Generic IO error occured while attempting to read or write data