o.semen
06/20/2018, 7:27 AMval b1: Byte = 2
val b3: Byte = 7
val b4 = b1 xor b3
and IDEA suggested import kotlin.experimental.xor
, but when I tried this:
val b1: Byte = 2
val b3: Byte = 7
val b4 = b1 shl b3
it does not have even anything to suggest.
It is sad as I’m implementing CRC calculation that requires quite a lot of binary operations on bytes an each time I have to cast my bytes….
I do realise that it is possible to write extension. But I’m still wandering why Byte is not treated the same way Int and Long is?darych
06/20/2018, 7:29 AMkarelpeeters
06/20/2018, 7:49 AMo.semen
06/20/2018, 7:52 AM"123".toByteArray()
PlatformUtils
in the serialization lib has String.toUtf8Bytes()