A skeleton implementation of both Encoder and CompositeEncoder that can be used for simple formats and for testability purpose. Most of the encode* methods have default implementation that delegates encodeValue(value: Any). See Encoder documentation for information about each particular encode* method.
Encodes the beginning of the collection with size collectionSize and the given serializer of its type parameters. This method has to be implemented only if you need to know collection size in advance, otherwise, beginStructure can be used.
Encodes the value of type T by delegating the encoding process to the given serializer. For example, encodeInt call us equivalent to delegating integer encoding to Int.serializer: encodeSerializableValue(Int.serializer())
Denotes the end of the structure associated with current encoder. For example, composite encoder of JSON format will write a closing bracket in the underlying input and reduce the number of nesting for pretty printing.