class Minecraft::EncryptedTCPSocket
- Minecraft::EncryptedTCPSocket
- IO
- Reference
- Object
Included Modules
Defined in:
minecraft/io.crConstructors
Instance Method Summary
- #close(*args, **options)
- #close(*args, **options, &)
- #closed?(*args, **options)
- #closed?(*args, **options, &)
- #flush(*args, **options)
- #flush(*args, **options, &)
-
#read(slice : Bytes)
Reads at most slice.size bytes from this
IO
into slice. - #read_cipher : OpenSSL::Cipher
-
#write(slice : Bytes) : Nil
Writes the contents of slice into this
IO
. - #write_cipher : OpenSSL::Cipher
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) : Stringread_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
Instance Method Detail
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