Travis Griggs
10/28/2019, 5:11 PMEvan R.
10/28/2019, 6:37 PM.map()
returns a list, not an array. The spread operator only works on arrays, so the following would work:
val UInt.le_ubytes:UByteArray get() {
val quad = (0 until 31 step 8 ).map { shift -> (this shr shift and 0xFFu).ubyte }
return ubyteArrayOf(*(quad.toTypedArray()))
}
Travis Griggs
10/28/2019, 6:37 PM