deserialize

override fun deserialize(decoder: Decoder): Zero

Deserializes the value of type Zero using the format represented by the specified decoder.

See the KSerializer.deserialize method for more details.


Calling from Kotlin

Here's an example of calling this method from Kotlin code:

val deserializer = ZeroAsByteSerializer()
val zero = Zero()
val decoded: Zero = zero.toByte()
.let(Json.Default::encodeToString)
.let { Json.decodeFromString(deserializer, string = it) }
assertEquals(expected = zero, decoded)