https://kotlinlang.org logo
#serialization
Title
# serialization
p

pablisco

10/20/2018, 7:26 AM
Yeah, that's the ideal scenario. I guess if the order is reversed it's the incorrect format 🙃
n

Nikky

10/20/2018, 8:34 AM
Copy code
override fun deserialize(input: Decoder): LockEntry {
            val structDecoder = input.beginStructure(descriptor)
            val first = structDecoder.decodeStringElement(descriptor, 0) // index 0 => first element in the class
            val data = structDecoder.decodeSerializableElement(descriptor, 1, SomeClass::class.serializer().list)
            structDecoder.endStructure()
        }
thats how this would look like in 0.8.2+
in 0.6.2 replace descriptor with serialClassDesc and the alls are named different but the structure is generally the same
p

pablisco

10/20/2018, 4:36 PM
Ok, I may update to the latest
4 Views