readULong
Removes eight bytes from this source and returns a big-endian, unsigned long.
val buffer = Buffer()
.writeByte(0xff)
.writeByte(0xff)
.writeByte(0xff)
.writeByte(0xff)
.writeByte(0xff)
.writeByte(0xff)
.writeByte(0xff)
.writeByte(0xfe)
.writeByte(0x00)
.writeByte(0x00)
.writeByte(0x00)
.writeByte(0x00)
.writeByte(0x00)
.writeByte(0x00)
.writeByte(0x00)
.writeByte(0x0f)
assertEquals(16, buffer.size)
assertEquals(18446744073709551614uL, buffer.readULong())
assertEquals(8, buffer.size)
assertEquals(15u, buffer.readULong())
assertEquals(0, buffer.size)Content copied to clipboard