readUShortLe

Removes two bytes from this source and returns an unsigned short integer composed of it according to the little-endian order.

Throws

when there are not enough data to read an unsigned short 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.writeUShort(0x1234U)
assertEquals(0x3412U, buffer.readUShortLe()) 
   //sampleEnd
}