Mychael Koelfat
11/04/2022, 12:15 PMclass SharedDiscover {
companion object {
fun parse(deviceId: Int, data: ByteArray, buffer: ByteBuffer): Boolean {
// Some code...
}
}
}
However, it has an unsolved reference to ByteBuffer. This links back to import java.nio.ByteBuffer
in the existing project, but in the shared folder I obviously cannot link to this, or at least not in this way. Does anyone have a workaround? Or any insight on how this works?jessel
11/04/2022, 12:24 PMjessel
11/04/2022, 12:25 PMjessel
11/04/2022, 12:25 PMMychael Koelfat
11/04/2022, 12:42 PMKevin S
11/09/2022, 7:09 PMjava
classes in androidMain
, but not in any other source set. So one approach would be to use the expect/ actual
functionality. Then you can expect
a Buffer
class, and then on the androidMain
side you can use the actual
ByteBuffer
since Android uses JVM
. Then on the iOS
side you would use NSData
or the swift alternative. You should be fine with Okio
but that’s generally how KMM
works.