decodeFromBufferedSource

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

Note that this functions expects that exactly one object would be present in the source and throws an exception if there are any dangling bytes after an object.

Throws

if the given JSON input cannot be deserialized to the value of type T.

If an I/O error occurs and source can't be read from.


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

Note that this functions expects that exactly one object would be present in the stream and throws an exception if there are any dangling bytes after an object.

Throws

if the given JSON input cannot be deserialized to the value of type T.

If an I/O error occurs and source can't be read from.