Kotlin convertion to and from the byte array
Recently I'm trying to make a byte array from an object of class containing a few variables of primitive types. The problem has began with saving a double to the 8-byte format. After getting it back retrieved value isn't the same but kind of very close.
First I checked such expression val value = Double.fromBits(1.2.toBits()) and it gave me a correct answer. So, I guess there's something wrong with my implementation of moving long integer into byte array but I can't find the bug.
Samples...