https://kotlinlang.org logo
j

jw

10/07/2016, 5:19 PM
Copy code
if (thing != null) {
  dest.writeInt(1)
  dest.writeInt(thing)
} else {
  dest.writeInt(0)
}
Copy code
val thing = dest.readInt() == 0 ? null : dest.readInt()