lz4.h 891 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include <util/stream/output.h>
  3. #include <util/stream/input.h>
  4. #include <util/generic/ptr.h>
  5. /**
  6. * @addtogroup Streams_Archs
  7. * @{
  8. */
  9. /**
  10. * Lz4 compressing stream.
  11. *
  12. * @see http://code.google.com/p/lz4/
  13. */
  14. class TLz4Compress: public IOutputStream {
  15. public:
  16. TLz4Compress(IOutputStream* slave, ui16 maxBlockSize = 1 << 15);
  17. ~TLz4Compress() override;
  18. private:
  19. void DoWrite(const void* buf, size_t len) override;
  20. void DoFlush() override;
  21. void DoFinish() override;
  22. private:
  23. class TImpl;
  24. THolder<TImpl> Impl_;
  25. };
  26. /**
  27. * Lz4 decompressing stream.
  28. *
  29. * @see http://code.google.com/p/lz4/
  30. */
  31. class TLz4Decompress: public IInputStream {
  32. public:
  33. TLz4Decompress(IInputStream* slave);
  34. ~TLz4Decompress() override;
  35. private:
  36. size_t DoRead(void* buf, size_t len) override;
  37. private:
  38. class TImpl;
  39. THolder<TImpl> Impl_;
  40. };
  41. /** @} */