Kirill Grouchnikov
08/26/2021, 7:39 PMByteArray
to byte[]
so that I can pass it to a Java method that accepts the "traditional" byte arrays?nschulzke
08/26/2021, 7:43 PMbyte[]
on the JVM, so you can pass it where one is required. This works for me:
import java.util.Arrays
val byteArray = ByteArray(10)
Arrays.fill(byteArray, 2)
for (byte in byteArray) {
print(byte)
}
Kirill Grouchnikov
08/26/2021, 7:46 PMephemient
08/26/2021, 8:00 PMlistOf(1)::class == listOf("a")::class // because erasure
arrayOf(1)::class != arrayOf("a")::class // because arrays of different element types have different representations