Crate zx0decompress

Crate zx0decompress 

Source
Expand description

Decompress data in zx0 format.

§Examples

Decompress from file into a Vec<u8>:

let filename = "something.zx0";
let mut source = std::fs::File::open(filename)?;
let content = zx0decompress::decompress(&mut source)?;

Decompress from a byte slice into a Vec<u8>:

let source = [
    0x1fu8, 0x41, 0x42, 0x52, 0x41, 0x20, 0xf6, 0xab, 0x43, 0x44, 0xf5, 0xf2, 0x55, 0x58,
];
let result = zx0decompress::decompress(&mut source.as_ref()).unwrap();
assert_eq!(&result, b"ABRA ABRACADABRA");

Structs§

Settings
Decompression settings

Enums§

DecompressError
An error that occured during decompression.

Functions§

decompress
Decompress data using the default settings. Reads data from the supplied source which is Read and return it as a Vec. Any failures to read from source will be returned.
decompress_with_settings
Decompress data using the given settings. Reads data from the supplied source which is Read and return it as a Vec. Any failures to read from source will be returned.