writeDoubleLe
Writes eight bytes of a bit representation of double, in the little-endian order, to this sink. Bit representation of the double corresponds to the IEEE 754 floating-point "double format" bit layout.
To obtain a bit representation, the Double.toBits function is used.
Should be used with care when working with special values (like NaN
) as bit patterns obtained for Double.NaN may vary depending on a platform.
Parameters
double
the floating point number 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.writeDoubleLe(123456.78901)
assertContentEquals(byteArrayOf(35, -13, -56, -97, 12, 36, -2, 64), buffer.readByteArray())
//sampleEnd
}