LZ4_compress_default

[LZ4_compress_default()](API\Runtime\Core\Compression\LZ4_compress_default) : Compresses 'srcSize' bytes from buffer 'src' into already allocated 'dst' buffer of size 'dstCapacity'.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Compression/lz4.h

Include

#include "Compression/lz4.h"

Source

/Engine/Source/Runtime/Core/Private/Compression/lz4.cpp

Syntax

LZ4int LZ4_compress_default
(
    const char * src,
    char * dst,
    int srcSize,
    int dstCapacity
)

Remarks

LZ4_compress_default() : Compresses 'srcSize' bytes from buffer 'src' into already allocated 'dst' buffer of size 'dstCapacity'. Compression is guaranteed to succeed if 'dstCapacity' >= LZ4_compressBound(srcSize). It also runs faster, so it's a recommended setting. If the function cannot compress 'src' into a more limited 'dst' budget, compression stops immediately, and the function result is zero. In which case, 'dst' content is undefined (invalid). srcSize : max supported value is LZ4_MAX_INPUT_SIZE. dstCapacity : size of buffer 'dst' (which must be already allocated)

: This function is protected against buffer overflow scenarios (never writes outside 'dst' buffer, nor read outside 'source' buffer).

Returns

: the number of bytes written into buffer 'dst' (necessarily <= dstCapacity) or 0 if compression fails

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss