struct MaxMindDB::Buffer
Defined in:
maxminddb/buffer.crConstructors
Instance Method Summary
- #position : Int32
- #position=(position : Int32)
-
#read(size : Int32) : Bytes
Reads size bytes from this bytes buffer.
-
#read_byte : UInt8
Read one byte from bytes buffer Returns 0 if and only if there is no more data to read.
-
#rindex(search : Bytes) : Int32 | Nil
Returns the index of the last appearance of search in the bytes buffer
- #size : Int32
Macro Summary
Instance methods inherited from struct Value
==(other : MaxMindDB::Any)
==
Instance methods inherited from class Object
===(other : MaxMindDB::Any)
===
Constructor Detail
Instance Method Detail
def read(size : Int32) : Bytes
#
Reads size bytes from this bytes buffer.
Returns empty Bytes
if and only if there is no
more data to read.
def read_byte : UInt8
#
Read one byte from bytes buffer Returns 0 if and only if there is no more data to read.
def rindex(search : Bytes) : Int32 | Nil
#
Returns the index of the last appearance of search in the bytes buffer
Buffer.new(Bytes[1, 2, 3, 4, 5]).rindex(Bytes[3, 4]) # => 2