parse

suspend fun parse(file: File): TimelineData

Parses the given file into a TimelineData object.

Return

The parsed TimelineData object.

Parameters

file

The JSON file of timeline data to be parsed.

Throws

if the file does not exist.

JsonDataException

if the JSON format is invalid.

if there's an error reading the file.


suspend fun parse(inputStream: InputStream): TimelineData

Parses the given input stream into a TimelineData object.

Return

The parsed TimelineData object.

Parameters

inputStream

The input stream of JSON data to be parsed.

Throws

JsonDataException

if the JSON format is invalid.

if there's an error reading the input stream.


suspend fun parse(bufferedSource: BufferedSource): TimelineData

Parses the given buffered source into a TimelineData object.

Return

The parsed TimelineData object.

Parameters

bufferedSource

The buffered source of JSON data to be parsed.

Throws

JsonDataException

if the JSON format is invalid.

if the data cannot be parsed (null result).

if there's an error reading the buffered source.