Kotlin Serialization to and from Amazon Ion format (JVM only).
data class DataHolder(val name: String, val id: Int)
// ...
val myData = DataHolder(name = "Fritz", id = 42)
Ion.encodeToString(myData) // == { name : "Fritz", id: 42 }
data class DataHolder(val name: String, val id: Int)
// ...
val myIon = """{ name : "Fritz", id: 42 }"""
Ion.decodeFromString<DataHolder>(myIon) // == DataHolder(name = "Fritz, id = 42)
data class DataHolder(val name: String, val id: Int)
// ...
val myData = DataHolder(name = "Fritz", id = 42)
Ion.encodeToBytes(myData) // == binary ION values
data class DataHolder(val name: String, val id: Int)
// ...
val myIon: ByteArray = //... get bytes
Ion.decodeFromBytes<DataHolder>(myIon) // == DataHolder(name = "Fritz", id = 42)