Class EndianBuffer

extends EndianWriter

Class summary


constructor --buffer/Buffer --byte-order/ByteOrder

Constructors

constructor --buffer/Buffer --byte-order/ByteOrder

Methods

float32 --at/int -> float
Returns the 32-bit float (single-precision) value at the given position at.

float64 --at/int -> float
Returns the 64-bit float (double-precision) value at the given position at.

int16 --at/int -> int
Returns the signed 16-bit value at the given position at.

int24 --at/int -> int
Returns the signed 24-bit value at the given position at.

int32 --at/int -> int
Returns the signed 32-bit value at the given position at.

int64 --at/int -> int
Returns the signed 64-bit value at the given position at.

int8 --at/int -> int
Returns the signed 8-bit value at the given position at.

operator == other/any -> bool
Whether this object is equal to the other.
By default, identical is used for equality.
Inheritance
Classes overwrite this operator to get an equality specific to their needs. Equality operators often compare the type and field contents. For example:

class Pin:
  number/int

  constructor .number:

  operator == other:
    if other is not Pin: return false
    return number == other.number
A class doesn't have to follow the above format, but it must keep the operator in sync with any hash-code method. That is, if a class has a hash-code member, then the equality and hash-code must agree. If two instances are equal (a == b), then their hash codes must also be equal (a.hash-code == b.hash-code).

put-float32 --at/int value/float -> none
Writes the given float32 value to this buffer at the given index at.

put-float64 --at/int value/float -> none
Writes the given float64 value to this buffer at the given index at.

put-int16 --at/int value/int -> none
Writes the given signed int16 value to this buffer at the given index at.

put-int24 --at/int value/int -> none
Writes the given signed int24 value to this buffer at the given index at.

put-int32 --at/int value/int -> none
Writes the given signed int32 value to this buffer at the given index at.

put-int64 --at/int value/int -> none
Writes the given int64 value to this buffer at the given index at.

put-int8 --at/int value/int -> none
Writes the given byte value to this buffer at the given index at.
This function is an alias for Buffer.[]=.

put-uint16 --at/int value/int -> none
Writes the given unsigned uint16 value to this buffer at the given index at.
This function is an alias for put-int16.

put-uint24 --at/int value/int -> none
Writes the given unsigned uint24 value to this buffer at the given index at.
This function is an alias for put-int24.

put-uint32 --at/int value/int -> none
Writes the given unsigned uint32 value to this buffer at the given index at.
This function is an alias for put-int32.

put-uint8 --at/int value/int -> none
Writes the given unsigned uint8 value to this buffer at the given index at.
This function is an alias for Buffer.[]= and put-int8.

Stringifies this object.
Inheritance
Objects that need a human-friendly string representation should overwrite this method. The default string is based on the internal class-ID.

uint16 --at/int -> int
Returns the unsigned 16-bit value at the given position at.

uint24 --at/int -> int
Returns the unsigned 24-bit value at the given position at.

uint32 --at/int -> int
Returns the unsigned 32-bit value at the given position at.

uint8 --at/int -> int
Returns the unsigned 8-bit value at the given position at.

write-float32 data/float -> none
Writes a 32-bit floating-point number, using the endianness of this instance.

write-float64 data/float -> none
Writes a 64-bit floating-point number, using the endianness of this instance.

write-int16 value/int -> none
Writes a signed 16-bit integer, using the endiannes of this instance.

write-int24 value/int -> none
Writes a signed 24-bit integer, using the endiannes of this instance.

write-int32 value/int -> none
Writes a signed 32-bit integer, using the endiannes of this instance.

write-int64 data/int -> none
Writes a signed 64-bit integer, using the endiannes of this instance.

write-int8 value/int -> none
Writes a singed 8-bit integer.

write-uint16 value/int -> none
Writes an unsigned 16-bit integer, using the endiannes of this instance.

write-uint24 value/int -> none
Writes an unsigned 24-bit integer, using the endiannes of this instance.

write-uint32 value/int -> none
Writes an unsigned 32-bit integer, using the endiannes of this instance.

write-uint8 value/int -> none
Writes an unsigned 8-bit integer.