Class Celluloid::IO::Stream
In: lib/celluloid/io/stream.rb
Parent: Socket

Base class of all streams in Celluloid::IO

Methods

<<   close   each   each_byte   each_line   eof   eof?   flush   getc   gets   new   print   printf   puts   read   readchar   readline   readlines   readpartial   sysread   syswrite   ungetc   wait_readable   wait_writable   write  

Included Modules

Enumerable

Classes and Modules

Class Celluloid::IO::Stream::Latch

Attributes

sync  [RW]  The "sync mode" of the stream

See IO#sync for full details.

Public Class methods

Public Instance methods

Writes s to the stream. s will be converted to a String using String#to_s.

Closes the stream and flushes any unwritten data.

Executes the block for every line in the stream where lines are separated by eol.

See also gets

Calls the given block once for each byte in the stream.

each_line(eol=$/)

Alias for each

eof()

Alias for eof?

Returns true if the stream is at file which means there is no more data to be read.

Flushes buffered data to the stream.

Reads one character from the stream. Returns nil if called at end of file.

Reads the next line from the stream. Lines are separated by eol. If limit is provided the result will not be longer than the given number of bytes.

eol may be a String or Regexp.

Unlike IO#gets the line read will not be assigned to +$_+.

Unlike IO#gets the separator must be provided if a limit is provided.

Writes args to the stream.

See IO#print for full details.

Formats and writes to the stream converting parameters under control of the format string.

See Kernel#sprintf for format string details.

Writes args to the stream along with a record separator.

See IO#puts for full details.

Reads size bytes from the stream. If buf is provided it must reference a string which will receive the data.

See IO#read for full details.

Reads a one-character string from the stream. Raises an EOFError at end of file.

Reads a line from the stream which is separated by eol.

Raises EOFError if at end of file.

Reads lines from the stream which are separated by eol.

See also gets

Reads at most maxlen bytes from the stream. If buf is provided it must reference a string which will receive the data.

See IO#readpartial for full details.

System read via the nonblocking subsystem

System write via the nonblocking subsystem

Pushes character c back onto the stream such that a subsequent buffered character read will return it.

Unlike IO#getc multiple bytes may be pushed back onto the stream.

Has no effect on unbuffered reads (such as sysread).

Wait until the current object is readable

Wait until the current object is writable

Writes s to the stream. If the argument is not a string it will be converted using String#to_s. Returns the number of bytes written.

[Validate]