2020-10-31 23:56:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-04-15 23:56:45 +00:00
|
|
|
#include <IO/CompressedReadBufferWrapper.h>
|
2020-10-31 23:56:41 +00:00
|
|
|
#include <IO/ReadBuffer.h>
|
|
|
|
|
2021-10-27 23:10:39 +00:00
|
|
|
#include <lzma.h>
|
2020-10-31 23:56:41 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2022-04-15 23:56:45 +00:00
|
|
|
class LZMAInflatingReadBuffer : public CompressedReadBufferWrapper
|
2020-10-31 23:56:41 +00:00
|
|
|
{
|
|
|
|
public:
|
2022-03-13 11:59:20 +00:00
|
|
|
explicit LZMAInflatingReadBuffer(
|
2020-10-31 23:56:41 +00:00
|
|
|
std::unique_ptr<ReadBuffer> in_,
|
|
|
|
size_t buf_size = DBMS_DEFAULT_BUFFER_SIZE,
|
|
|
|
char * existing_memory = nullptr,
|
|
|
|
size_t alignment = 0);
|
|
|
|
|
2020-11-09 22:52:22 +00:00
|
|
|
~LZMAInflatingReadBuffer() override;
|
2020-10-31 23:56:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool nextImpl() override;
|
|
|
|
|
2020-11-11 01:50:56 +00:00
|
|
|
lzma_stream lstr;
|
2021-12-30 04:47:34 +00:00
|
|
|
bool eof_flag;
|
2020-10-31 23:56:41 +00:00
|
|
|
};
|
2020-11-12 09:21:33 +00:00
|
|
|
|
2020-11-03 23:47:39 +00:00
|
|
|
}
|