class IO::Stream::Generic

def readable?

@returns [Boolean] If the stream is readable, i.e. a `read` operation has a chance of success.
Whether there is a chance that a read operation will succeed or not.
def readable?
	# If we are at the end of the file, we can't read any more data:
	if @eof
		return false
	end
	
	# If the read buffer is not empty, we can read more data:
	if !@read_buffer.empty?
		return true
	end
	
	# If the underlying stream is readable, we can read more data:
	return !closed?
end