2 ms·
I mentioned above, but in Kotlin going from a packed C struct to JVM: Mapping for C type to ByteBuffer call: uint16_t -> getShort().toUShort(
by BoorishBears 4y ago
I mentioned above, but in Kotlin going from a packed C struct to JVM:
Mapping for C type to ByteBuffer call:
uint16_t -> getShort().toUShort()
uint32_t -> getInt().toUInt()
int32_t -> getInt()
It's not the most ergonomic set of calls, but definitely limits the error prone nature of it all since if you try to pass an Int into a function that needs a UInt, you'll get a compiler error