Buffer.readVar

Reads a varint.

  1. T readVar()
    class Buffer
    pure @safe
    T
    readVar
    (
    T
    )
    ()
    if (
    isIntegral!T &&
    T.sizeof > 1
    )
  2. B read()

Throws

BufferOverflowException if there isn't enough data to read.

Examples

t {
		
		import xbuffer.varint;
		
		Buffer buffer = new Buffer(cast(ubyte[])[2, 1]);
		assert(buffer.readVar!int() == 1);
		assert(buffer.read!varuint() == 1);
	

Meta