#include "serialization.h"
#include "log.h"
#include "util/serialize.h"
#include <zlib.h>
#include <zstd.h>
#include <memory>
Classes | |
class | ZlibAutoDeleter< F > |
struct | ZSTD_Deleter |
Functions | |
static void | zerr (int ret) |
void | compressZlib (const u8 *data, size_t data_size, std::ostream &os, int level) |
void | decompressZlib (std::istream &is, std::ostream &os, size_t limit) |
void | compressZstd (const u8 *data, size_t data_size, std::ostream &os, int level) |
void | decompressZstd (std::istream &is, std::ostream &os) |
void | compress (const u8 *data, u32 size, std::ostream &os, u8 version, int level) |
void | decompress (std::istream &is, std::ostream &os, u8 version) |
void compress | ( | const u8 * | data, |
u32 | size, | ||
std::ostream & | os, | ||
u8 | version, | ||
int | level ) |
References compressZlib(), compressZstd(), and writeU32().
Referenced by compress(), ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), MapBlock::serialize(), Schematic::serializeToMts(), and TestCompression::testRLECompression().
void compressZlib | ( | const u8 * | data, |
size_t | data_size, | ||
std::ostream & | os, | ||
int | level ) |
References zerr().
Referenced by TestCompression::_testZlibLimit(), compress(), compressZlib(), encodePNG(), ModApiUtil::l_compress(), Server::SendItemDef(), Server::sendMetadataChanged(), Server::SendNodeDef(), TestCompression::testZlibCompression(), and TestCompression::testZlibLargeData().
void compressZstd | ( | const u8 * | data, |
size_t | data_size, | ||
std::ostream & | os, | ||
int | level ) |
References dstream.
Referenced by compress(), compressZstd(), ModApiUtil::l_compress(), and TestCompression::testZstdLargeData().
void decompress | ( | std::istream & | is, |
std::ostream & | os, | ||
u8 | version ) |
References decompressZlib(), decompressZstd(), and readU32().
Referenced by MapBlock::deSerialize(), MapBlock::deSerialize_pre22(), Schematic::deserializeFromMts(), ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), and TestCompression::testRLECompression().
void decompressZlib | ( | std::istream & | is, |
std::ostream & | os, | ||
size_t | limit ) |
References dstream, and zerr().
Referenced by TestCompression::_testZlibLimit(), decompress(), MapBlock::deSerialize_pre22(), Client::handleCommand_ItemDef(), Client::handleCommand_NodeDef(), Client::handleCommand_NodemetaChanged(), ModApiUtil::l_decompress(), TestCompression::testZlibCompression(), and TestCompression::testZlibLargeData().
void decompressZstd | ( | std::istream & | is, |
std::ostream & | os ) |
References dstream.
Referenced by decompress(), ModApiUtil::l_decompress(), TestMapBlock::testSave29(), and TestCompression::testZstdLargeData().
|
static |
References dstream.
Referenced by compressZlib(), and decompressZlib().