class Ronin::Support::Binary::Array

Represents an Array of binary types that can be read from and written to.

@note This class provides lazy memory mapped access to an underlying buffer. This means values are decoded/encoded each time they are read or written to.

## Examples

Creating an array of ‘int32`s:

array = Binary::Binary::Array.new(:int32, 4)
# => #<Ronin::Support::Binary::Binary::Array: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00">
array[0] = 0x11111111
array[1] = 0x22222222
array[2] = 0x33333333
array[3] = -1
array.to_s
# => "\x11\x11\x11\x11\"\"\"\"3333\xFF\xFF\xFF\xFF"

Creating an array from an existing String:

array = Binary::Array.new(:uint32_le, "\x41\x00\x00\x00\x42\x00\x00\x00")
# => #<Ronin::Support::Binary::Binary::Array: "A\u0000\u0000\u0000B\u0000\u0000\u0000">
array[0]
# => 65
array[1]
# => 66

@api public

@since 1.0.0