Number of the bytes read.
$(D_KEYWORD this).
ReadBuffer!ubyte b; size_t numberRead; ubyte[] result; // Fills the buffer with values 0..10 numberRead = fillBuffer(b[], 0, 10); b += numberRead; result = b[0 .. $]; assert(result[0] == 0); assert(result[1] == 1); assert(result[9] == 9); b.clear(); // It shouldn't overwrite, but append another 5 bytes to the buffer numberRead = fillBuffer(b[], 0, 10); b += numberRead; numberRead = fillBuffer(b[], 20, 25); b += numberRead; result = b[0..$]; assert(result[0] == 0); assert(result[1] == 1); assert(result[9] == 9); assert(result[10] == 20); assert(result[14] == 24);
Appends some data to the buffer.