Returns the number of bytes read, calling the underlying read function the minimal number of times until the buffer has at least len
bytes filled. If the number read is less than len
it means the stream reached the end. Reaching the end of the stream is not an error condition.