aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/IO/LZMAInflatingReadBuffer.h
blob: 5fd29d6f7d317d58ceddc7efb3fbf592081d46a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include <IO/CompressedReadBufferWrapper.h>
#include <IO/ReadBuffer.h>

#include <lzma.h>

namespace DB
{

class LZMAInflatingReadBuffer : public CompressedReadBufferWrapper
{
public:
    explicit LZMAInflatingReadBuffer(
        std::unique_ptr<ReadBuffer> in_,
        size_t buf_size = DBMS_DEFAULT_BUFFER_SIZE,
        char * existing_memory = nullptr,
        size_t alignment = 0);

    ~LZMAInflatingReadBuffer() override;

private:
    bool nextImpl() override;

    lzma_stream lstr;
    bool eof_flag;
};

}