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
- Decompression settings
Enums
- An error that occured during decompression.
Functions
- Decompress data using the default settings. Reads data from the supplied
source
which isRead
and return it as aVec
. Any failures to read fromsource
will be returned. - Decompress data using the given settings. Reads data from the supplied
source
which isRead
and return it as aVec
. Any failures to read fromsource
will be returned.