Buffer chunk got with $(D_PSYMBOL buffer).
auto b = defaultAllocator.make!WriteBuffer(4); ubyte[3] buf = [48, 23, 255]; b ~= buf; assert(b.capacity == 4); assert(b.buffer_[0] == 48 && b.buffer_[1] == 23 && b.buffer_[2] == 255); b += 2; b ~= buf; assert(b.capacity == 4); assert(b.buffer_[0] == 23 && b.buffer_[1] == 255 && b.buffer_[2] == 255 && b.buffer_[3] == 48); b += 2; b ~= buf; assert(b.capacity == 8); assert(b.buffer_[0] == 23 && b.buffer_[1] == 255 && b.buffer_[2] == 48 && b.buffer_[3] == 23 && b.buffer_[4] == 255); defaultAllocator.dispose(b); b = make!WriteBuffer(defaultAllocator, 2); b ~= buf; assert(b.start == 0); assert(b.capacity == 4); assert(b.ring == 3); assert(b.position == 3); defaultAllocator.dispose(b);
Appends data to the buffer.