use compact size for collections (I think I tried this already and it failed - but I'm going to wipe all data this time, so hopefully it works)

This commit is contained in:
Adam 2022-02-20 12:32:17 +01:00
parent 2aed3a670c
commit a8337552e6

View file

@ -65,7 +65,7 @@ class KxsDataOutputEncoder(
descriptor: SerialDescriptor,
collectionSize: Int
): CompositeEncoder {
encodeInt(collectionSize)
encodeCompactSize(collectionSize)
return this
}
@ -125,7 +125,7 @@ class KxsDataInputDecoder(
override fun decodeSequentially(): Boolean = true
override fun decodeCollectionSize(descriptor: SerialDescriptor): Int =
decodeInt().also { elementsCount = it }
decodeCompactSize().also { elementsCount = it }
override fun decodeNotNullMark(): Boolean = decodeBoolean()