20#ifndef RIPPLED_COMPRESSION_H_INCLUDED
21#define RIPPLED_COMPRESSION_H_INCLUDED
23#include <xrpl/basics/CompressionAlgorithms.h>
24#include <xrpl/basics/Log.h>
29namespace compression {
48template <
typename InputStream>
61 in, inSize, decompressed, decompressedSize);
65 <<
"decompress: invalid compression algorithm "
66 <<
static_cast<int>(algorithm);
68 "ripple::compression::decompress : invalid compression "
87template <
class BufferFactory>
99 in, inSize, std::forward<BufferFactory>(bf));
102 JLOG(
debugLog().warn()) <<
"compress: invalid compression algorithm"
103 <<
static_cast<int>(algorithm);
105 "ripple::compression::compress : invalid compression "
std::size_t lz4Compress(void const *in, std::size_t inSize, BufferFactory &&bf)
LZ4 block compression.
std::size_t lz4Decompress(std::uint8_t const *in, std::size_t inSizeUnchecked, std::uint8_t *decompressed, std::size_t decompressedSizeUnchecked)
std::size_t constexpr headerBytes
std::size_t compress(void const *in, std::size_t inSize, BufferFactory &&bf, Algorithm algorithm=Algorithm::LZ4)
Compress input data.
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.
std::size_t constexpr headerBytesCompressed
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
beast::Journal debugLog()
Returns a debug journal.