WriteBuffer.opOpAssign

Sets how many bytes were written. It will shrink the buffer appropriately. Always set this property after calling $(D_PSYMBOL buffer).

  1. WriteBuffer opOpAssign(ubyte[] buffer)
  2. size_t opOpAssign [@property setter]
    class WriteBuffer
    @property pure nothrow @safe @nogc
    opOpAssign
    (
    string op
    )
    (
    size_t length
    )
    if (
    op == "+"
    )

Parameters

length size_t

Length of the written data.

Return Value

$(D_KEYWORD this).

Examples

auto b = defaultAllocator.make!WriteBuffer;
ubyte[6] buf = [23, 23, 255, 128, 127, 9];

b ~= buf;
assert(b.length == 6);
b += 2;
assert(b.length == 4);
b += 4;
assert(b.length == 0);

defaultAllocator.dispose(b);

Meta