decodeFromStream

fun <T> Json5.decodeFromStream(deserializer: DeserializationStrategy<T>, inputStream: InputStream): T(source)

Deserializes the JSON5 input from inputStream using the given deserializer and returns an equivalent object hierarchy.

Data read from the InputStream is expected to have UTF-8 encoding.

Return

The created object hierarchy.

Parameters

deserializer

DeserializationStrategy to use for the deserialization.

inputStream

UTF-8-encoded stream to read the JSON5 input from.

Throws

ParsingError

The provided input cannot be parsed.

DecodingError

The provided input is incompatible with the data model.

An error occurred while reading from inputStream.


inline fun <T> Json5.decodeFromStream(inputStream: InputStream): T(source)

Convenience function that calls Json5.decodeFromStream with the default serializer for the type.