lzma.h 775 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <util/stream/input.h>
  3. #include <util/stream/output.h>
  4. #include <util/stream/zerocopy.h>
  5. #include <util/generic/ptr.h>
  6. class TLzmaCompress: public IOutputStream {
  7. public:
  8. TLzmaCompress(IOutputStream* slave, size_t level = 7);
  9. ~TLzmaCompress() override;
  10. private:
  11. void DoWrite(const void* buf, size_t len) override;
  12. void DoFinish() override;
  13. private:
  14. class TImpl;
  15. THolder<TImpl> Impl_;
  16. };
  17. class TLzmaDecompress: public IInputStream {
  18. public:
  19. TLzmaDecompress(IInputStream* slave);
  20. TLzmaDecompress(IZeroCopyInput* input);
  21. ~TLzmaDecompress() override;
  22. private:
  23. size_t DoRead(void* buf, size_t len) override;
  24. private:
  25. class TImpl;
  26. class TImplStream;
  27. class TImplZeroCopy;
  28. THolder<TImpl> Impl_;
  29. };