Do not require that streambuf has bytes available
The function basic_streambuf::in_avail() only returns the number of bytes *currently* available in the get area. Since we're dealing with a theoretically unbounded stream, the get area will be reused continuously, and in_avail() only represents a snapshot in time. Instead, we now check whether we got the amount of bytes we needed. This allows the streambuffer to call underflow() internally to replenish its get area.
Showing
Please register or sign in to comment