Navigation
API > API/Runtime > API/Runtime/Core
Description
LZ4_compress_destSize() : Reverse the logic : compresses as much data as possible from 'src' buffer into already allocated buffer 'dst', of size >= 'targetDestSize'. This function either compresses the entire 'src' content into 'dst' if it's large enough, or fill 'dst' buffer completely with as much data as possible from 'src'. note: acceleration parameter is fixed to "default".
*srcSizePtr : will be modified to indicate how many bytes where read from 'src' to fill 'dst'. New value is necessarily <= input value. Note : from v1.8.2 to v1.9.1, this function had a bug (fixed un v1.9.2+): the produced compressed content could, in specific circumstances, require to be decompressed into a destination buffer larger by at least 1 byte than the content to decompress. If an application uses `LZ4compress_destSize(), it's highly recommended to update liblz4 to v1.9.2 or better. If this can't be done or ensured, the receiving decompression function should provide a dstCapacity which is > decompressedSize, by at least 1 byte. See https://github.com/lz4/lz4/issues/859 for details
| Name | LZ4_compress_destSize |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Compression/lz4.h |
| Include Path | #include "Compression/lz4.h" |
| Source | /Engine/Source/Runtime/Core/Private/Compression/lz4.cpp |
LZ4int LZ4_compress_destSize
(
const char * src,
char * dst,
int * srcSizePtr,
int targetDstSize
)
: Nb bytes written into 'dst' (necessarily <= targetDestSize) or 0 if compression fails.