mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
███████████: development.
This commit is contained in:
parent
a11485e186
commit
7b88ae65d8
@ -73,11 +73,28 @@ public:
|
||||
void ignore()
|
||||
{
|
||||
if (!eof())
|
||||
{
|
||||
++pos;
|
||||
++bytes_read;
|
||||
}
|
||||
else
|
||||
throw Exception("Attempt to read after eof", ErrorCodes::ATTEMPT_TO_READ_AFTER_EOF);
|
||||
}
|
||||
|
||||
void ignore(size_t n)
|
||||
{
|
||||
while (!eof() && n != 0)
|
||||
{
|
||||
size_t bytes_to_ignore = std::min(static_cast<size_t>(working_buffer.end() - pos), n);
|
||||
pos += bytes_to_ignore;
|
||||
n -= bytes_to_ignore;
|
||||
bytes_read += bytes_to_ignore;
|
||||
}
|
||||
|
||||
if (n)
|
||||
throw Exception("Attempt to read after eof", ErrorCodes::ATTEMPT_TO_READ_AFTER_EOF);
|
||||
}
|
||||
|
||||
/** Читает столько, сколько есть, не больше n байт. */
|
||||
size_t read(char * to, size_t n)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user