#pragma once #include #if USE_SNAPPY #include #include #include namespace DB { class SnappyReadBuffer : public BufferWithOwnMemory { public: explicit SnappyReadBuffer( std::unique_ptr in_, size_t buf_size = DBMS_DEFAULT_BUFFER_SIZE, char * existing_memory = nullptr, size_t alignment = 0); ~SnappyReadBuffer() override; bool nextImpl() override; off_t seek(off_t off, int whence) override; off_t getPosition() override; private: std::unique_ptr in; String compress_buffer; String uncompress_buffer; }; } #endif