writeLong

open override fun writeLong(long: Long)(source)

Writes eight bytes containing long, in the big-endian order, to this sink.

Parameters

long

the long integer to be written.

Throws

when the sink is closed.

Samples

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

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

buffer.writeLong(42)
assertContentEquals(byteArrayOf(0, 0, 0, 0, 0, 0, 0, 42), buffer.readByteArray()) 
   //sampleEnd
}