Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Misc > API/Runtime/Core/Misc/FCompression
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Misc/Compression.h |
Include | #include "Misc/Compression.h" |
Source | /Engine/Source/Runtime/Core/Private/Misc/Compression.cpp |
static bool CompressMemory
&40;
FName FormatName,
void &42; CompressedBuffer,
int32 & CompressedSize,
const void &42; UncompressedBuffer,
int32 UncompressedSize,
ECompressionFlags Flags,
int32 CompressionData
&41;
Remarks
Thread-safe abstract compression routine. Compresses memory from uncompressed buffer and writes it to compressed buffer. Updates CompressedSize with size of compressed data. Compression controlled by the passed in flags. CompressMemory is expected to return true and write valid data even if it expanded bytes. Always check CompressedSize >= UncompressedSize and fall back to uncompressed, or use CompressMemoryIfWorthDecompressing true if compression succeeds, false if it fails because CompressedBuffer was too small or other reasons
Parameters
Name | Description |
---|---|
FormatName | Name of the compression format |
CompressedBuffer | Buffer compressed data is going to be written to |
CompressedSize | [in/out] Size of CompressedBuffer, at exit will be size of compressed data |
UncompressedBuffer | Buffer containing uncompressed data |
UncompressedSize | Size of uncompressed data in bytes |
Flags | Flags to control what method to use and optionally control memory vs speed |
CompressionData | Additional compression parameter (specifies BitWindow value for ZLIB compression format) |