ReplicaNet and RNLobby
1
|
#include <XPCompression.h>
Public Member Functions | |
XPCompression () | |
virtual | ~XPCompression () |
int | CalculateMaximumMemory (int size) |
bool | Compress (void *source_data, int source_length, void *destination_data, int *destination_length, int level=10) |
bool | Decompress (void *source_data, int source_length, void *destination_data, int *destination_length, int max_buffer_size) |
A general purpose lossless compression and decompression class which implements the LZMPi compression algorithm.
XPCompression | ( | ) |
The ctor performs some basic initialisation
|
virtual |
The dtor makes sure everything is tidy
int CalculateMaximumMemory | ( | int | size | ) |
Given an input size calculate the maximum absolute worse case for the compressed output
size | the size of the data |
bool Compress | ( | void * | source_data, |
int | source_length, | ||
void * | destination_data, | ||
int * | destination_length, | ||
int | level = 10 |
||
) |
Compress a block of memory
source_data | the source data |
source_length | the source data length in bytes |
destination_data | the destination data |
destination_length | the pointer to the destination data length in bytes to fill in |
level | the compression level to use. 1 is fast and 10 is best but slower. The default for this parameter is 10. Compression level 6 is a good balance between compression ratio and speed. |
bool Decompress | ( | void * | source_data, |
int | source_length, | ||
void * | destination_data, | ||
int * | destination_length, | ||
int | max_buffer_size | ||
) |
Decompress a block of memory
source_data | the source data |
source_length | the source data length in bytes |
destination_data | the destination data |
destination_length | the pointer to the destination data length in bytes to fill in |
max_buffer_size | the maximum size of the destination buffer |