compressed.h 523 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "coded.h"
  3. #include <util/memory/tempbuf.h>
  4. #include <util/stream/zerocopy.h>
  5. #include <util/stream/mem.h>
  6. namespace NClickHouse {
  7. class TCompressedInput: public IZeroCopyInput {
  8. public:
  9. TCompressedInput(TCodedInputStream* input);
  10. ~TCompressedInput();
  11. protected:
  12. size_t DoNext(const void** ptr, size_t len) override;
  13. bool Decompress();
  14. private:
  15. TCodedInputStream* const Input_;
  16. TTempBuf Data_;
  17. TMemoryInput Mem_;
  18. };
  19. }