#pragma once #include #include #include #include #include namespace DB { class Lz4InflatingReadBuffer : public BufferWithOwnMemory { public: Lz4InflatingReadBuffer( std::unique_ptr in_, size_t buf_size = DBMS_DEFAULT_BUFFER_SIZE, char * existing_memory = nullptr, size_t alignment = 0); ~Lz4InflatingReadBuffer() override; private: bool nextImpl() override; std::unique_ptr in; LZ4F_dctx* dctx; void * in_data; void * out_data; size_t in_available; size_t out_available; bool eof_flag = false; }; }