Buffer.this

Creates a buffer from an array of data. The chunk size is set to the size of the array.

  1. this(size_t chunk)
  2. this(T[] data)
    class Buffer
    pure nothrow @trusted @nogc
    this
    (
    T
    )
    (
    in T[] data...
    )
    if (
    is(T == void)
    )

Examples

t {

		Buffer buffer = new Buffer(cast(ubyte[])[1, 2, 3, 4]);
		assert(buffer.rindex == 0);
		assert(buffer.windex == 4);

		buffer = new Buffer([1, 2]);
		assert(buffer.rindex == 0);
		assert(buffer.windex == 8);
	

Meta