In swift I have array with data: [Uint8]. In kotl...
# kotlin-native
k
In swift I have array with data: [Uint8]. In kotlin i have class that should process that data. What kotlin type i should use, that could hold this value? List<Byte> gives [NSNumber], but it will create new object. I wonder if i could avoid creating new objects.
In other words, I need to pass [UInt8] as a reference from Swift to Kotlin so it could process it.
a
Can’t provide more info but seems when I generate a kotlin method which needs an
Int
, it will be converted to
UInt32
in swift side. Maybe you need to cast int8 to int32?
s
o
it was closed, because unsigned types will be implemented universally across all Kotlin flavours, and with frontend support
k
I'm also fine with "passing reference to memory block" and convert it in kotlin later on demand. Not sure if it is possible...
o
yes, just use
CPointer<ByteVar>
, and restore data from there.
k
@olonho can't find that class in swift or kotlin...