ClickHouse/src/IO/HTTPChunkedReadBuffer.h
2021-03-29 20:49:28 +03:00

25 lines
459 B
C++

#pragma once
#include <IO/BufferWithOwnMemory.h>
#include <IO/ReadBuffer.h>
namespace DB
{
/// Reads data with HTTP Chunked Transfer Encoding.
class HTTPChunkedReadBuffer : public BufferWithOwnMemory<ReadBuffer>
{
public:
explicit HTTPChunkedReadBuffer(std::unique_ptr<ReadBuffer> in_) : in(std::move(in_)) {}
private:
std::unique_ptr<ReadBuffer> in;
size_t readChunkHeader();
void readChunkFooter();
bool nextImpl() override;
};
}