36 , m_bufferSize(bufferSize)
38 BOOST_ASSERT(bufferSize > 0);
42 StreamSource::doPump()
44 BOOST_ASSERT(
m_next !=
nullptr);
46 std::vector<uint8_t> buffer(m_bufferSize);
47 size_t dataOffset = 0;
50 while (dataLen > 0 || !m_is.eof()) {
53 size_t nBytesWritten =
m_next->write(&buffer[dataOffset], dataLen);
55 dataOffset += nBytesWritten;
56 dataLen -= nBytesWritten;
61 else if (m_is.good()) {
62 m_is.read(reinterpret_cast<char*>(&buffer.front()), buffer.size());
64 dataLen = m_is.gcount();