20 #ifndef RIPPLED_COMPRESSION_H_INCLUDED
21 #define RIPPLED_COMPRESSION_H_INCLUDED
23 #include <ripple/basics/CompressionAlgorithms.h>
24 #include <ripple/basics/Log.h>
29 namespace compression {
52 template<
typename InputStream>
60 decompressed, decompressedSize);
63 JLOG(
debugLog().warn()) <<
"decompress: invalid compression algorithm "
64 <<
static_cast<int>(algorithm);
81 template<
class BufferFactory>
91 JLOG(
debugLog().warn()) <<
"compress: invalid compression algorithm"
92 <<
static_cast<int>(algorithm);
103 #endif //RIPPLED_COMPRESSION_H_INCLUDED
constexpr std::size_t headerBytes
beast::Journal debugLog()
Returns a debug journal.
std::size_t compress(void const *in, std::size_t inSize, BufferFactory &&bf, Algorithm algorithm=Algorithm::LZ4)
Compress input data.
std::size_t lz4Decompress(std::uint8_t const *in, std::size_t inSize, std::uint8_t *decompressed, std::size_t decompressedSize)
std::size_t decompress(InputStream &in, std::size_t inSize, std::uint8_t *decompressed, std::size_t decompressedSize, Algorithm algorithm=Algorithm::LZ4)
Decompress input stream.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::size_t lz4Compress(void const *in, std::size_t inSize, BufferFactory &&bf)
LZ4 block compression.
constexpr std::size_t headerBytesCompressed