mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 14:11:58 +00:00
26 lines
395 B
C++
26 lines
395 B
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <IO/ReadBuffer.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/** Allows to read from another ReadBuffer no more than the specified number of bytes.
|
|
*/
|
|
class LimitReadBuffer : public ReadBuffer
|
|
{
|
|
private:
|
|
ReadBuffer & in;
|
|
size_t limit;
|
|
|
|
bool nextImpl() override;
|
|
|
|
public:
|
|
LimitReadBuffer(ReadBuffer & in_, size_t limit_);
|
|
~LimitReadBuffer() override;
|
|
};
|
|
|
|
}
|