Make sure that we really read the requested number of bytes from a stream