WriteBuffer.opOpAssign

Sets how many bytes were written. It will shrink the buffer appropriately. Always call it after $(D_PSYMBOL opIndex).

  1. WriteBuffer opOpAssign(T[] buffer)
  2. WriteBuffer opOpAssign(size_t length)
    struct WriteBuffer(T = ubyte)
    ref
    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 = WriteBuffer!ubyte(6);
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);

Meta