BufferOverflowException if there isn't enough data to read.
t { Buffer buffer = new Buffer("!hello"); assert(buffer.read!(ubyte[])(1) == [33]); assert(buffer.read!string(5) == "hello"); buffer.data = [1, 2, 3]; version(BigEndian) assert(buffer.data!ubyte == [0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3]); version(LittleEndian) assert(buffer.data!ubyte == [1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]); assert(buffer.read!(int[])(3) == [1, 2, 3]);
Reads an array using the system's endianness.