module IO

Included Modules

JSON::Builder

Direct including types

BufferedIOMixin, HTTP::ChunkedContent, HTTP::FixedLengthContent, JSON::PrettyWriter, OpenSSL::SSL::Socket, PointerIO, String::Builder, StringIO

Defined in:

Class Method Summary

Instance Method Summary

Macro Summary

Class Method Detail

def self.copy(src, dst)

def self.pipe(read_blocking = false, write_blocking = false, &block)

def self.pipe(read_blocking = false, write_blocking = false)

def self.select(read_ios, write_ios, error_ios, timeout_sec : LibC::TimeT | Int | Float | Nil)

Returns an array of all given IOs that are

If the optional timeout_sec is given, nil is returned if no IO was ready after the specified amount of seconds passed. Fractions are supported.

If timeout_sec is nil, this method blocks until an IO is ready.


def self.select(read_ios, write_ios = nil, error_ios = nil)

Instance Method Detail

def <<(obj)

Writes the given object into this IO. This ends up calling to_s(io) on the object.


def cooked(&block)

def cooked!

def each_byte

def each_byte(&block)

def each_char(&block)

def each_char

def each_line

def each_line(&block)

def flush

def gets(delimiter : Char)

def gets(limit : Int)

def gets(delimiter : String)

def gets(delimiter : Char, limit : Int)

def gets

def print(obj)

Same as #<<


def print(*objects : _)

def printf(format_string, *args)

def printf(format_string, args : Array | Tuple)

def puts

def puts(string : String)

Writes the given string to this IO followed by a newline character unless the string already ends with one.


def puts(obj)

Writes the given object to this IO followed by a newline character.


def puts(*objects : _)

def raw(&block)

def raw!

def read(length : Int)

def read(slice : Slice(UInt8))

abstract def read(slice : Slice(UInt8), count)

Reads count bytes from this IO into slice. Returns the number of bytes read.


def read

def read_byte

def read_char

def read_char_with_bytesize

def read_fully(buffer : Slice(UInt8))

def read_line(*args)

def read_nonblock(length)

def tty?

abstract def write(slice : Slice(UInt8), count)

Writes count bytes from slice into this IO. Returns the number of bytes written.


def write(slice : Slice(UInt8))

def write(array : Array(UInt8))

def write_byte(byte : UInt8)

Macro Detail

macro cooked_from_tc_mode!

macro raw_from_tc_mode!