t { Buffer buffer = new Buffer(8); buffer.write!(Endian.bigEndian)([1, 2, 3]); assert(buffer.capacity == 16); assert(buffer.data!ubyte == [0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3]); buffer.reset(); buffer.write!(Endian.littleEndian)(cast(short[])[-2, 2]); assert(buffer.data!ubyte == [254, 255, 2, 0]); buffer.reset(); buffer.write!(Endian.bigEndian, wstring)("test"w); assert(buffer.data!ubyte == [0, 't', 0, 'e', 0, 's', 0, 't']);
Writes an array using the given endianness.