Function lzf::decompress [] [src]

pub fn decompress(data: &[u8], out_len_should: usize) -> LzfResult<Vec<u8>>

Decompress the given data, if possible. An error will be returned if decompression 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);