Function uclcli::decompress_into_buffer[][src]

pub fn decompress_into_buffer(
    src: &[u8],
    dst: &mut [u8]
) -> Result<u32, UclErrorKind>
Expand description

decompress a NRV compressed buffer into another buffer

If dst is not big enough to hold the decompressed buffer, this will return Err(UclErrorKind::OutputOverrun). If decompression succeeded, this will return the number of usable bytes in dst.

Panics

If ucl_init was not called prior to calling this function, this function will panic.

let mut buf = [0xffu8; 1024];
assert_eq!(uclcli::decompress_into_buffer(b"\x92\xa5\xaa\xa1\x00\x00\x00\x00\x00\x04\x80\xff", &mut buf), Ok(1024));
assert_eq!(buf, [0xa5u8; 1024]);