readLong

open override fun readLong(): Long(source)

Removes eight bytes from this source and returns a long integer composed of it according to the big-endian order.

Throws

when there are not enough data to read a long value.

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.write(byteArrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))

assertEquals(0x0102030405060708L, buffer.readLong())
assertEquals(2, buffer.size) 
   //sampleEnd
}