Function lzf::decompress
[-] [+]
[src]
pub fn decompress(data: &[u8], out_len: usize) -> LzfResult<Vec<u8>>
Decompress the given data, if possible. The return value will be set to the error if compression fails.
The length of the output buffer can be specified. If the output buffer is not large enough to hold the decompressed data, BufferTooSmall is returned. Otherwise the number of decompressed bytes (i.e. the original length of the data) is returned.
If an error in the compressed data is detected, DataCorrupted is returned.
Example:
let data = "[your-compressed-data]"; let decompressed = lzf::decompress(data.as_bytes(), 10);