![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
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.
| 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.
| OutCompressed | The destination TArray. |
| InData | The memory to compress. |
| InDataSize | The number of bytes in the InData buffer. |
| InCompressor | The Oodle compressor to use. See discussion. |
| InLevel | The compression level to use. See discussion. |
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!
| bool CORE_API FOodleCompressedArray::CompressData64 | ( | TArray64< uint8 > & | OutCompressed, |
| const void * | InData, | ||
| int64 | InDataSize, | ||
| FOodleDataCompression::ECompressor | InCompressor, | ||
| FOodleDataCompression::ECompressionLevel | InLevel | ||
| ) |
| 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.
| bool FOodleCompressedArray::CompressTArray64 | ( | TArray64< uint8 > & | OutCompressed, |
| const TArray64< T > & | InBuffer, | ||
| FOodleDataCompression::ECompressor | InCompressor, | ||
| FOodleDataCompression::ECompressionLevel | InLevel | ||
| ) |
| 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.
| OutDestinationBuffer | The pointer to contain the allocated buffer that contains the decompressed data. |
| OutDestinationBufferSize | Will recieve the size of the buffer allocated. |
| InCompressed | A TArray created by one of the FOodleCompressedArray compression functions. |
| bool CORE_API FOodleCompressedArray::DecompressToAllocatedBuffer64 | ( | void *& | OutDestinationBuffer, |
| int64 & | OutDestinationBufferSize, | ||
| TArray64< uint8 > const & | InCompressed | ||
| ) |
| 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.
| InDestinationBuffer | The buffer to contain the decompressed data. |
| InDestinationBufferSize | Allocated size of InDestinationBuffer; if it is not large enough to hold the decompressed data (as reported by PeekSizes), this function will return false. |
| InCompressed | A TArray created by one of the FOodleCompressedArray compression functions. |
| bool CORE_API FOodleCompressedArray::DecompressToExistingBuffer64 | ( | void * | InDestinationBuffer, |
| int64 | InDestinationBufferSize, | ||
| TArray64< uint8 > const & | InCompressed | ||
| ) |
| bool FOodleCompressedArray::DecompressToTArray | ( | TArray< T > & | OutDecompressed, |
| TArray< uint8 > const & | InCompressed | ||
| ) |
Decompress to a TArray. This should be paired with CompressTArray.
| OutDecompressed | The output TArray. Existing contents will be destroyed. |
| InCompressed | A TArray created by one of the FOodleCompressedArray compression functions. |
| bool FOodleCompressedArray::DecompressToTArray64 | ( | TArray64< T > & | OutDecompressed, |
| TArray64< uint8 > const & | InCompressed | ||
| ) |
|
inline |
Provides access to the compressed and decompressed sizes.
| InCompressed | A TArray generated by a call to one of the FOodleCompressedArray compression functions. |
| OutCompressedSize | The amount of compressed data (The array Num() is this plus the header size). |
| OutDecompressedSize | The number of bytes decompressing the data will produce. |