class Minecraft::IO::Wrap

Included Modules

Defined in:

minecraft/io.cr

Constructors

Instance Method Summary

Instance methods inherited from module Minecraft::IO

read_angle256_deg : Float32 read_angle256_deg, read_bit_location : Rosegold::Vec3i read_bit_location, read_bool read_bool, read_byte read_byte, read_double : Float64 read_double, read_float : Float32 read_float, read_int : Int32 read_int, read_long : Int64 read_long, read_nbt : Minecraft::NBT::Tag read_nbt, read_opt_string : String | Nil read_opt_string, read_short : Int16 read_short, read_signed_byte read_signed_byte, read_ushort : UInt16 read_ushort, read_uuid : UUID read_uuid, read_var_bytes : Bytes read_var_bytes, read_var_int : UInt32 read_var_int, read_var_long : UInt64 read_var_long, read_var_string(size : UInt32) : String
read_var_string : String
read_var_string
, write(x : Int32, y : Int32, z : Int32)
write(value : Bool)
write(str : String)
write(value : Float32 | Float64 | UInt8 | Int8)
write(uuid : UUID)
write(value : UInt16 | Int16 | UInt32 | Int32 | UInt64 | Int64)
write(nbt : NBT::Tag)
write(slot : Rosegold::Slot)
write(location : Rosegold::Vec3i)
write
, write_angle256_deg(deg : Float32 | Float64) write_angle256_deg, write_full(value : UInt16 | Int16 | UInt32 | Int32 | UInt64 | Int64 | Float32 | Float64) write_full, write_opt_string(str : String | Nil) write_opt_string

Constructor Detail

def self.new(io : ::IO) #

[View source]

Instance Method Detail

def close(*args, **options) #

[View source]
def close(*args, **options, &) #

[View source]
def closed?(*args, **options) #

[View source]
def closed?(*args, **options, &) #

[View source]
def flush(*args, **options) #

[View source]
def flush(*args, **options, &) #

[View source]
def peek(*args, **options) #

[View source]
def peek(*args, **options, &) #

[View source]
def read(slice : Bytes) #
Description copied from class IO

Reads at most slice.size bytes from this IO into slice. Returns the number of bytes read, which is 0 if and only if there is no more data to read (so checking for 0 is the way to detect end of file).

io = IO::Memory.new "hello"
slice = Bytes.new(4)
io.read(slice) # => 4
slice          # => Bytes[104, 101, 108, 108]
io.read(slice) # => 1
slice          # => Bytes[111, 101, 108, 108]
io.read(slice) # => 0

[View source]
def write(slice : Bytes) : Nil #
Description copied from class IO

Writes the contents of slice into this IO.

io = IO::Memory.new
slice = Bytes.new(4) { |i| ('a'.ord + i).to_u8 }
io.write(slice)
io.to_s # => "abcd"

[View source]