struct MaxMindDB::Buffer

Defined in:

maxminddb/buffer.cr

Constructors

Instance Method Summary

Macro Summary

Instance methods inherited from struct Value

==(other : MaxMindDB::Any) ==

Instance methods inherited from class Object

===(other : MaxMindDB::Any) ===

Constructor Detail

def self.new(bytes : Bytes) #

[View source]

Instance Method Detail

def position : Int32 #

[View source]
def position=(position : Int32) #

[View source]
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.


[View source]
def read_byte : UInt8 #

Read one byte from bytes buffer Returns 0 if and only if there is no more data to read.


[View source]
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

[View source]
def size : Int32 #

[View source]

Macro Detail

macro method_missing(call) #

[View source]