class

MySql::ReadPacket

Inherits IO < Reference < Object

Constructors

new(io : IO, connection : Connection)
Source

Instance methods

discard
Source
read(slice : Bytes)

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
Source
read_blob
Source
read_byte!
Source
read_byte_array(length)
Source
read_fixed_int(n)

TODO: should return different types of int depending on n value (note: update Connection#read_column_definitions to remote to_i16/to_i8)

Source
read_int
Source
read_int64_string(length)
Source
read_int_string(length)
Source
read_lenenc_int(h = read_byte!)
Source
read_lenenc_string
Source
read_string(length)
Source
read_string
Source
to_s(io)
Source
write(slice) : Nil
Source