Fill the given buffer with data from the given inputstream.
Fill the given buffer with data from the given inputstream. Blocks until the input stream has enough data to fill the buffer or is closed.
The input stream
the buffer to fill
state of input stream and the bytes read
Useful input stream utils.