FCompression::CompressMemory

Thread-safe abstract compression routine.

Windows
MacOS
Linux

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

Syntax

static bool CompressMemory
(
    FName FormatName,
    void * CompressedBuffer,
    int32 & CompressedSize,
    const void * UncompressedBuffer,
    int32 UncompressedSize,
    ECompressionFlags Flags,
    int32 CompressionData
)

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.

Returns

true if compression succeeds, false if it fails because CompressedBuffer was too small or other reasons

Parameters

Parameter

Description

Flags

Flags to control what method to use and optionally control memory vs speed

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

BitWindow

Bit window to use in compression

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