readFloatLe

Removes four bytes from this source and returns a floating point number with type Float composed of it according to the little-endian order.

The Float.Companion.fromBits function is used for decoding bytes into Float.

Throws

when there are not enough data to read an unsigned int value.

when the source is closed.

Samples

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

fun main() { 
   //sampleStart 
   val buffer = Buffer()
buffer.write(byteArrayOf(-74, -26, 64, 70))
assertEquals(12345.678F.toBits(), buffer.readFloatLe().toBits()) 
   //sampleEnd
}