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 {
48 template <
typename InputStream>
61 in, inSize, decompressed, decompressedSize);
65 <<
"decompress: invalid compression algorithm "
66 <<
static_cast<int>(algorithm);
85 template <
class BufferFactory>
97 in, inSize, std::forward<BufferFactory>(bf));
100 JLOG(
debugLog().warn()) <<
"compress: invalid compression algorithm"
101 <<
static_cast<int>(algorithm);
114 #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 inSizeUnchecked, std::uint8_t *decompressed, std::size_t decompressedSizeUnchecked)
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