Compressor implemeted with LZ4.
More...
#include <tkrzw_compress.h>
Compressor implemeted with LZ4.
◆ LZ4Compressor()
tkrzw::LZ4Compressor::LZ4Compressor |
( |
int32_t |
acceleration = 1 | ) |
|
|
explicit |
Constructor.
- Parameters
-
acceleration | The accelaration level which is 1 or more. Increasing it by 1 means 3-4% speed boost with less compression ratio. |
◆ ~LZ4Compressor()
virtual tkrzw::LZ4Compressor::~LZ4Compressor |
( |
| ) |
|
|
virtual |
◆ IsSupported()
bool tkrzw::LZ4Compressor::IsSupported |
( |
| ) |
const |
|
overridevirtual |
Checks whether the implementation is actually supported.
- Returns
- True if the implementation is actually supported.
Implements tkrzw::Compressor.
◆ Compress()
char* tkrzw::LZ4Compressor::Compress |
( |
const void * |
buf, |
|
|
size_t |
size, |
|
|
size_t * |
sp |
|
) |
| const |
|
overridevirtual |
Compresses a serial data.
- Parameters
-
buf | the input buffer. |
size | the size of the input buffer. |
sp | the pointer to the variable into which the size of the region of the return value is assigned. |
- Returns
- The pointer to the result data, or nullptr on failure.
Because the region of the return value is allocated with the xmalloc function, it should be released with the xfree function.
Implements tkrzw::Compressor.
◆ Decompress()
char* tkrzw::LZ4Compressor::Decompress |
( |
const void * |
buf, |
|
|
size_t |
size, |
|
|
size_t * |
sp |
|
) |
| const |
|
overridevirtual |
Decompresses a serial data.
- Parameters
-
buf | the input buffer. |
size | the size of the input buffer. |
sp | the pointer to the variable into which the size of the region of the return value is assigned. |
- Returns
- The pointer to the result data, or nullptr on failure.
Because the region of the return value is allocated with the xmalloc function, it should be released with the xfree function.
Implements tkrzw::Compressor.
◆ MakeCompressor()
std::unique_ptr<Compressor> tkrzw::LZ4Compressor::MakeCompressor |
( |
| ) |
const |
|
overridevirtual |