Update ReadBufferFromIStream.cpp

This commit is contained in:
alexey-milovidov 2018-07-10 23:43:38 +03:00
parent 21a5a7a544
commit 1737228039

View File

@ -14,7 +14,6 @@ bool ReadBufferFromIStream::nextImpl()
{
istr.read(internal_buffer.begin(), internal_buffer.size());
size_t gcount = istr.gcount();
read_bytes += gcount;
if (!gcount)
{
@ -22,9 +21,9 @@ bool ReadBufferFromIStream::nextImpl()
return false;
if (istr.fail())
throw Exception("Cannot read from istream at " + std::to_string(read_bytes), ErrorCodes::CANNOT_READ_FROM_ISTREAM);
throw Exception("Cannot read from istream at offset " + count(), ErrorCodes::CANNOT_READ_FROM_ISTREAM);
throw Exception("Unexpected state of istream at " + std::to_string(read_bytes), ErrorCodes::CANNOT_READ_FROM_ISTREAM);
throw Exception("Unexpected state of istream at offset " + count(), ErrorCodes::CANNOT_READ_FROM_ISTREAM);
}
else
working_buffer.resize(gcount);