writeByte

abstract fun writeByte(byte: Byte)(source)

Writes a byte to this sink.

Parameters

byte

the byte to be written.

Throws

when the sink is closed.

when some I/O error occurs.

Samples

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

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

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