bufferΒΆ

meth (Source: address):buffer: buffer

Allocates a new buffer with the same size and initial contents as Source.

buffer("Hello world") :> <11:48656C6C6F20776F726C64>
type buffer < address

A buffer represents a writable bounded section of memory.

meth (Buffer: buffer):put(Value: address): buffer

Puts the bytes of Value in Buffer.

buffer(10):put("Hello\0\0\0\0\0")
:> <10:48656C6C6F0000000000>
meth (Buffer: buffer):put16(Value: integer): buffer

Puts Value in Buffer as an 16-bit signed value. Currently follows the platform endiness.

buffer(2):put16(12345) :> <2:3930>
meth (Buffer: buffer):put32(Value: integer): buffer

Puts Value in Buffer as an 32-bit signed value. Currently follows the platform endiness.

buffer(4):put32(12345678) :> <4:4E61BC00>
meth (Buffer: buffer):put64(Value: integer): buffer

Puts Value in Buffer as an 64-bit signed value. Currently follows the platform endiness.

buffer(8):put64(123456789123) :> <8:831A99BE1C000000>
meth (Buffer: buffer):put8(Value: integer): buffer

Puts Value in Buffer as an 8-bit signed value.

buffer(1):put8(64) :> <1:40>
meth (Buffer: buffer):putf32(Value: real): buffer

Puts Value in Buffer as a single precision floating point value. Currently follows the platform endiness.

buffer(4):putf32(1.23456789) :> <4:52069E3F>
meth (Buffer: buffer):putf64(Value: real): buffer

Puts Value in Buffer as a double precision floating point value. Currently follows the platform endiness.

buffer(8):putf64(1.23456789) :> <8:1BDE8342CAC0F33F>
meth (Length: integer):buffer: buffer

Allocates a new buffer with Length bytes.

buffer(16) :> <16:40928EF3617F00007461736B3A3A6C69>