20#ifndef RIPPLED_COMPRESSION_H_INCLUDED
21#define RIPPLED_COMPRESSION_H_INCLUDED
23#include <xrpl/basics/CompressionAlgorithms.h>
24#include <xrpl/basics/Log.h>
28namespace compression {
47template <
typename InputStream>
60 in, inSize, decompressed, decompressedSize);
64 <<
"decompress: invalid compression algorithm "
65 <<
static_cast<int>(algorithm);
67 "ripple::compression::decompress : invalid compression "
86template <
class BufferFactory>
98 in, inSize, std::forward<BufferFactory>(bf));
101 JLOG(
debugLog().warn()) <<
"compress: invalid compression algorithm"
102 <<
static_cast<int>(algorithm);
104 "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.