encodeCollection

inline fun Encoder.encodeCollection(descriptor: SerialDescriptor, collectionSize: Int, crossinline block: CompositeEncoder.() -> Unit)(source)

Begins a collection, encodes it using the given block and ends it.


inline fun <E> Encoder.encodeCollection(descriptor: SerialDescriptor, collection: Collection<E>, crossinline block: CompositeEncoder.(index: Int, E) -> Unit)(source)

Begins a collection, calls block with each item and ends the collections.