#pragma once #include #include class IZeroCopyInput; /** * Unbuffered decompressing stream for .XZ and .LZMA files. * * Do not use it for reading in small pieces. */ class TUnbufferedXzDecompress: public IInputStream { public: TUnbufferedXzDecompress(IInputStream* slave); TUnbufferedXzDecompress(IZeroCopyInput* slave); ~TUnbufferedXzDecompress() override; private: size_t DoRead(void* buf, size_t len) override; private: class TImpl; std::unique_ptr Impl_; }; /** * Buffered decompressing stream for .XZ and .LZMA files. * * Supports efficient `ReadLine` calls and similar "reading in small pieces" * usage patterns. */ class TXzDecompress: public TBuffered { public: template inline TXzDecompress(T&& t, size_t buf = 1 << 13) : TBuffered(buf, std::forward(t)) { } };