[−][src]Function lz_fear::raw::decompress_raw
pub fn decompress_raw(
input: &[u8],
prefix: &[u8],
output: &mut Vec<u8>,
output_limit: usize
) -> Result<(), DecodeError>
Decompress an LZ4-compressed block.
Note that LZ4 heavily relies on a lookback mechanism where bytes earlier in the output stream are referenced.
You may either pre-initialize the output buffer with this data or pass it separately in prefix
.
In particular, an LZ4 "dictionary" should (probably) be implemented as a prefix
because you obviously
don't want the dictionary to appear at the beginning of the output.
This function is based around memory buffers because that's what LZ4 intends. If your blocks don't fit in your memory, you should use smaller blocks.
output_limit
specifies a soft upper limit for the size of output
(including
the data you passed on input). Note that this is only a measure to protect from
DoS attacks and in the worst case, we may exceed it by up to input.len()
bytes.