pub unsafe extern "C" fn compression_decode_buffer(
dst_buffer: *mut uint8_t,
dst_size: size_t,
src: *const uint8_t,
src_size: size_t,
scratch_buffer: *mut c_void,
algorithm: compression_algorithm,
) -> size_t
Expand description
Decompresses the contents of a source buffer into a destination buffer.
§Arguments
dst_buffer
- Pointer to the buffer that receives the decompressed data.dst_size
- Size of the destination buffer in bytes.src
- Pointer to a buffer containing all of the source data.src_size
- Size of the data in the source buffer in bytes.scratch_buffer
- If scratch_buffer is not nil, this parameter is a pointer to a buffer that the function uses for scratch purposes. The size of this buffer must be at least the size returned by a previous call tocompression_decode_scratch_buffer_size
.Ifscratch_buffer
isnil
, the function creates and manages its own scratch space, but with a possible performance hit.algorithm
- Set to the desired algorithm:compression_algorithm::LZ4
,compression_algorithm::ZLIB
,compression_algorithm::LZMA
, orcompression_algorithm::LZFSE
.
§Returns
The number of bytes written to the destination buffer after decompressing the input. If there is not enough space in the destination buffer to hold the entire decompressed output, the function writes the first dst_size bytes to the buffer and returns dst_size. Note that this behavior differs from that of compression_encode_buffer
.