Buffer.readData

Reads the amount of data requested.

class Buffer
pure @safe
void[]
readData
(
size_t size
)

Throws

BufferOverflowException if there isn't enough data to read.

Examples

t {
		
		Buffer buffer = new Buffer([1]);
		assert(buffer.read!int() == 1);
		try {
			buffer.read!int(); assert(0);
		} catch(BufferOverflowException ex) {
			assert(ex.file == __FILE__);
		}
	

Meta