32 , m_bufferSize(bufferSize)
34 BOOST_ASSERT(bufferSize > 0);
38 StreamSource::doPump()
40 BOOST_ASSERT(
m_next !=
nullptr);
42 std::vector<uint8_t> buffer(m_bufferSize);
43 size_t dataOffset = 0;
46 while (dataLen > 0 || !m_is.eof()) {
49 size_t nBytesWritten =
m_next->write({&buffer[dataOffset], dataLen});
51 dataOffset += nBytesWritten;
52 dataLen -= nBytesWritten;
57 else if (m_is.good()) {
58 m_is.read(
reinterpret_cast<char*
>(&buffer.front()), buffer.size());
60 dataLen = m_is.gcount();