I just the answer in this post How to convert a Data Class to ByteBuffer in Kotlin?
And it works as expected. The problem is that nearly all data types are possible to put except the unsigned once. There are putLong etc. functions for bytebuffers but not for putULong.
Any hint would be apreciated.
Kind regards,
C.W.
There is an one-to-one correspondence between
ULongandLong, so you can convertULongtoLong, put that into the buffer, and vice versa when reading. For convenience, declare these extension functions:and they can be called just like
get/put*().