The OpenD Programming Language

ionPut

Examples

ubyte[19] data = void;
assert(ionPut(data.ptr, 0u) == 1);
assert(data[0] == 0x20);
assert(ionPut(data.ptr, 0u, true) == 1);
assert(data[0] == 0x30);
assert(ionPut(data.ptr, 0xFFu) == 2);
assert(data[0] == 0x21);
assert(data[1] == 0xFF);
assert(ionPut(data.ptr, 0xFFu, true) == 2);
assert(data[0] == 0x31);
assert(data[1] == 0xFF);

assert(ionPut(data.ptr, ulong.max, true) == 9);
assert(data[0] == 0x38);
assert(data[1] == 0xFF);
assert(data[2] == 0xFF);
assert(data[3] == 0xFF);
assert(data[4] == 0xFF);
assert(data[5] == 0xFF);
assert(data[6] == 0xFF);
assert(data[7] == 0xFF);
assert(data[8] == 0xFF);

Meta