Package-level declarations

Extensions for kotlinx.serialization.json.Json for integration with the kotlinx-io library.

Functions

Link copied to clipboard

Deserializes the contents of given source to the value of type T using UTF-8 encoding and deserializer retrieved from the reified type parameter.

Deserializes JSON from source using UTF-8 encoding to a value of type T using deserializer.

Link copied to clipboard
inline fun <T> Json.decodeSourceToSequence(source: Source, format: DecodeSequenceMode = DecodeSequenceMode.AUTO_DETECT): Sequence<T>

Transforms the given source into lazily deserialized sequence of elements of type T using UTF-8 encoding and deserializer retrieved from the reified type parameter. Unlike decodeSourceToSequence, source is allowed to have more than one element, separated as format declares.

fun <T> Json.decodeSourceToSequence(source: Source, deserializer: DeserializationStrategy<T>, format: DecodeSequenceMode = DecodeSequenceMode.AUTO_DETECT): Sequence<T>

Transforms the given source into lazily deserialized sequence of elements of type T using UTF-8 encoding and deserializer. Unlike decodeFromSource, source is allowed to have more than one element, separated as format declares.

Link copied to clipboard

Serializes given value to a sink using UTF-8 encoding and serializer retrieved from the reified type parameter.

Serializes the value with serializer into a sink using JSON format and UTF-8 encoding.