readHexadecimalUnsignedLong

Reads a long form this source in hexadecimal form (i.e., as a string in base 16).

Source data will be consumed until the source is exhausted, the first occurrence of non-digit byte, or overflow happened during resulting value construction.

Throws

if the found hexadecimal does not fit into a long or hexadecimal was not found.

if the source is exhausted before a call of this method.

when the source is closed.

when some I/O error occurs.

Samples

import kotlinx.io.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   val buffer = Buffer()

buffer.writeString("0000a")
assertEquals(10L, buffer.readHexadecimalUnsignedLong())

buffer.writeString("fffFffFffFfffff6")
assertEquals(-10L, buffer.readHexadecimalUnsignedLong())

buffer.writeString("dear friend!")
assertEquals(0xdea, buffer.readHexadecimalUnsignedLong())
assertEquals("r friend!", buffer.readString()) 
   //sampleEnd
}