双倍
val double = 1.2345
How can I convert that to a Kotlin ByteArray
, and/or Array<Byte>
?
Whose content would look like the following after converting 1.2345
00111111 11110011 11000000 10000011
00010010 01101110 10010111 10001101
In Java, there is a sollution that involves Double.doubleToLongBits()
(A static method of java.lang.Double), but in Kotlin, Double refers to Kotlin.Double
, which has no such (or any other useful in this situation) method.
我不介意一个解决方案是否会在这个文件中产生Kotlin.Double
个不可访问的结果.:)