UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FOodleCompressedArray Namespace Reference

Functions

bool CORE_API CompressData (TArray< uint8 > &OutCompressed, const void *InData, int32 InDataSize, FOodleDataCompression::ECompressor InCompressor, FOodleDataCompression::ECompressionLevel InLevel)
 
bool CORE_API CompressData64 (TArray64< uint8 > &OutCompressed, const void *InData, int64 InDataSize, FOodleDataCompression::ECompressor InCompressor, FOodleDataCompression::ECompressionLevel InLevel)
 
bool CORE_API DecompressToExistingBuffer (void *InDestinationBuffer, int64 InDestinationBufferSize, TArray< uint8 > const &InCompressed)
 
bool CORE_API DecompressToExistingBuffer64 (void *InDestinationBuffer, int64 InDestinationBufferSize, TArray64< uint8 > const &InCompressed)
 
bool CORE_API DecompressToAllocatedBuffer (void *&OutDestinationBuffer, int32 &OutDestinationBufferSize, TArray< uint8 > const &InCompressed)
 
bool CORE_API DecompressToAllocatedBuffer64 (void *&OutDestinationBuffer, int64 &OutDestinationBufferSize, TArray64< uint8 > const &InCompressed)
 
int32 PeekSizes (TArray< uint8 > const &InCompressed, int32 &OutCompressedSize, int32 &OutDecompressedSize)
 
int32 PeekSizes64 (TArray64< uint8 > const &InCompressed, int64 &OutCompressedSize, int64 &OutDecompressedSize)
 
template<class T >
bool CompressTArray (TArray< uint8 > &OutCompressed, const TArray< T > &InBuffer, FOodleDataCompression::ECompressor InCompressor, FOodleDataCompression::ECompressionLevel InLevel)
 
template<class T >
bool CompressTArray64 (TArray64< uint8 > &OutCompressed, const TArray64< T > &InBuffer, FOodleDataCompression::ECompressor InCompressor, FOodleDataCompression::ECompressionLevel InLevel)
 
template<class T >
bool DecompressToTArray (TArray< T > &OutDecompressed, TArray< uint8 > const &InCompressed)
 
template<class T >
bool DecompressToTArray64 (TArray64< T > &OutDecompressed, TArray64< uint8 > const &InCompressed)
 

Detailed Description

Represents a compressed buffer prefixed with the compressed and decompressed size. The compressed size is technically double-specified, but affords writing the buffer to disk without any further header. This header is variable sized based on need - 32 bits unless the sizes require it, then its 64 bit.

This is distinct from FCompressedBuffer as it has less overhead, is not intended to seamlessly interface with IoStore, and only supports built-in Oodle.

NOTE any data that will be staged to a pak/iostore should NOT be compressed, as that system will compress for you in a manner appropriate for the platform!

If you just want raw pointers, call OodleDataCompress/Decompress directly.

Function Documentation

◆ CompressData()

bool CORE_API FOodleCompressedArray::CompressData ( TArray< uint8 > &  OutCompressed,
const void InData,
int32  InDataSize,
FOodleDataCompression::ECompressor  InCompressor,
FOodleDataCompression::ECompressionLevel  InLevel 
)

Compress an arbitrary data pointer, replacing existing data.

Parameters
OutCompressedThe destination TArray.
InDataThe memory to compress.
InDataSizeThe number of bytes in the InData buffer.
InCompressorThe Oodle compressor to use. See discussion.
InLevelThe compression level to use. See discussion.
Returns
Success or failure. Failure is usually bad parameter or out-of-memory.

Oodle exposes two knobs for compression - the compression type and the compression level. Type more or less trades decompression speed for compression ratio, and level more or less trades compression speed for ratio.

This makes selection very usage case specific, and it's tough to just recommend a one-size-fits-all parameter set. If you have access to Epic Slack, ask in oodle-dev. Some more detailed explanation exists adjacent to the EOodleDataCompressor and EOodleDataCompressionLevel declarations.

For common use cases, reference GetCompressorAndLevelForCommonUsage()

NOTE any data that will be staged to a pak/iostore should NOT be compressed, as that system will compress for you in a manner appropriate for the platform!

◆ CompressData64()

bool CORE_API FOodleCompressedArray::CompressData64 ( TArray64< uint8 > &  OutCompressed,
const void InData,
int64  InDataSize,
FOodleDataCompression::ECompressor  InCompressor,
FOodleDataCompression::ECompressionLevel  InLevel 
)

◆ CompressTArray()

template<class T >
bool FOodleCompressedArray::CompressTArray ( TArray< uint8 > &  OutCompressed,
const TArray< T > &  InBuffer,
FOodleDataCompression::ECompressor  InCompressor,
FOodleDataCompression::ECompressionLevel  InLevel 
)

Compress an arbitrary data pointer, replacing existing data.

This is just a thunk to CompressData, and exists just for type safety so everyone doesn't have to pull out the raw data from their TArrays.

See CompressData for parameter discussion.

◆ CompressTArray64()

template<class T >
bool FOodleCompressedArray::CompressTArray64 ( TArray64< uint8 > &  OutCompressed,
const TArray64< T > &  InBuffer,
FOodleDataCompression::ECompressor  InCompressor,
FOodleDataCompression::ECompressionLevel  InLevel 
)

◆ DecompressToAllocatedBuffer()

bool CORE_API FOodleCompressedArray::DecompressToAllocatedBuffer ( void *&  OutDestinationBuffer,
int32 OutDestinationBufferSize,
TArray< uint8 > const &  InCompressed 
)

Decompresses a compressed TArray to a buffer that will be allocated by this function.

Parameters
OutDestinationBufferThe pointer to contain the allocated buffer that contains the decompressed data.
OutDestinationBufferSizeWill recieve the size of the buffer allocated.
InCompressedA TArray created by one of the FOodleCompressedArray compression functions.
Returns
Success or failure. Failure is usually because the TArray doesn't actually contain any data, but might fail because 64 bit is needed.

◆ DecompressToAllocatedBuffer64()

bool CORE_API FOodleCompressedArray::DecompressToAllocatedBuffer64 ( void *&  OutDestinationBuffer,
int64 OutDestinationBufferSize,
TArray64< uint8 > const &  InCompressed 
)

◆ DecompressToExistingBuffer()

bool CORE_API FOodleCompressedArray::DecompressToExistingBuffer ( void InDestinationBuffer,
int64  InDestinationBufferSize,
TArray< uint8 > const &  InCompressed 
)

Decompresses a compressed TArray to a buffer that has already been allocated.

Parameters
InDestinationBufferThe buffer to contain the decompressed data.
InDestinationBufferSizeAllocated size of InDestinationBuffer; if it is not large enough to hold the decompressed data (as reported by PeekSizes), this function will return false.
InCompressedA TArray created by one of the FOodleCompressedArray compression functions.
Returns
Success or failure. Failure is usually because the FCompressedArray doesn't actually contain any data, but might fail because 64 bit is needed.

◆ DecompressToExistingBuffer64()

bool CORE_API FOodleCompressedArray::DecompressToExistingBuffer64 ( void InDestinationBuffer,
int64  InDestinationBufferSize,
TArray64< uint8 > const &  InCompressed 
)

◆ DecompressToTArray()

template<class T >
bool FOodleCompressedArray::DecompressToTArray ( TArray< T > &  OutDecompressed,
TArray< uint8 > const &  InCompressed 
)

Decompress to a TArray. This should be paired with CompressTArray.

Parameters
OutDecompressedThe output TArray. Existing contents will be destroyed.
InCompressedA TArray created by one of the FOodleCompressedArray compression functions.
Returns
Success or failure. Note that if the compress/decompress TArray types are mismatched (i.e. have different sizes) this could fail due to granularity concerns.

◆ DecompressToTArray64()

template<class T >
bool FOodleCompressedArray::DecompressToTArray64 ( TArray64< T > &  OutDecompressed,
TArray64< uint8 > const &  InCompressed 
)

◆ PeekSizes()

int32 FOodleCompressedArray::PeekSizes ( TArray< uint8 > const &  InCompressed,
int32 OutCompressedSize,
int32 OutDecompressedSize 
)
inline

Provides access to the compressed and decompressed sizes.

Parameters
InCompressedA TArray generated by a call to one of the FOodleCompressedArray compression functions.
OutCompressedSizeThe amount of compressed data (The array Num() is this plus the header size).
OutDecompressedSizeThe number of bytes decompressing the data will produce.
Returns
0 if the FCompressedArray isn't valid, or if the compressed array requires PeekSizes64. Otherwise, the offset to the compressed data in the array.

◆ PeekSizes64()

int32 FOodleCompressedArray::PeekSizes64 ( TArray64< uint8 > const &  InCompressed,
int64 OutCompressedSize,
int64 OutDecompressedSize 
)
inline