Hi!
I’ve got a large byte array (a bitmap) on Swift side inside UInt8[] array.
How do I pass it to Kotlin?
I have found this answer on Stack Overflow, but it looks very inefficient - every byte is copied in cycle.
Is there a more effective way to transfer the byte array?
object in Swift from your UInt8[] array, you’ll be able to produce a Kotlin
ByteArray
p
Pavel Repkin
12/25/2021, 6:23 AM
Thank you so much, Benoit! That was the right direction.
Turned out converting UInt8[] to Data is pretty straightforward.
let data = Data(bytes: uint8Array, count: arrayLength)