class MySql::ReadPacket
- MySql::ReadPacket
- IO
- Reference
- Object
Defined in:
mysql/read_packet.crConstructors
Instance Method Summary
- #discard
-
#read(slice : Bytes)
Reads at most slice.size bytes from this
IO
into slice. - #read_blob
- #read_byte!
- #read_byte_array(length)
-
#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)
- #read_int
- #read_int64_string(length)
- #read_int_string(length)
- #read_lenenc_int(h = read_byte!)
- #read_lenenc_string
- #read_string(length)
- #read_string
- #to_s(io)
- #write(slice) : Nil
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
def 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)