class IO
@namespace
def self.Stream(io)
@parameter io [IO] The IO object to wrap.
Convert any IO-like object into a buffered stream.
def self.Stream(io) if io.is_a?(Stream::Buffered) io else Stream::Buffered.wrap(io) end end
def buffered=(value)
Set the buffered state of the IO.
def buffered=(value) self.sync = !value end
def buffered?
Check if the IO is buffered.
def buffered? return !self.sync end
def readable?
Check if the IO is readable.
def readable? # Do not call `eof?` here as it is not concurrency-safe and it can block. !closed? end