ubyte[20] data; ubyte[] result = [0x85, 'v', 'a', 'l', 'u', 'e']; auto str = "value"; assert(data[0 .. ionPut(data.ptr, str)] == result); result = [ubyte(0x8E), ubyte(0x90)] ~ cast(ubyte[])"hexadecimal23456"; str = "hexadecimal23456"; assert(data[0 .. ionPut(data.ptr, str)] == result);
Writes an Ion-encoded value to a byte buffer at ptr and returns the number of bytes written. (community summary)