fun readFrom(reader: Reader): JsonObject
Reads a JSON object from the given reader.
Characters are read in chunks and buffered internally, therefore wrapping an existing reader in
an additional BufferedReader
does not improve reading
performance.
reader
- the reader to read the JSON object from
IOException
- if an I/O error occurs in the reader
ParseException
- if the input is not valid JSON
UnsupportedOperationException
- if the input does not contain a JSON object
Return
the JSON object that has been read
fun readFrom(string: String): JsonObject
Reads a JSON object from the given string.
string
- the string that contains the JSON object
ParseException
- if the input is not valid JSON
UnsupportedOperationException
- if the input does not contain a JSON object
Return
the JSON object that has been read