BufferedSourceJsonReader
A JsonWriter that reads json from an okio BufferedSource
The base implementation was taken from Moshi and ported to Kotlin multiplatform with some tweaks to make it better suited for GraphQL (see JsonReader).
To read from a Map, see also MapJsonReader
Constructors
Types
Functions
Consumes the next token from the JSON stream and asserts that it is the beginning of a new array.
Consumes the next token from the JSON stream and asserts that it is the beginning of a new object.
Consumes the next token from the JSON stream and asserts that it is the end of the current array.
Consumes the next token from the JSON stream and asserts that it is the end of the current object.
Returns the Token.BOOLEAN value of the next token, consuming it.
Returns the Token.NUMBER value of the next token, consuming it.
Returns the Token.NUMBER value of the next token, consuming it.
Returns the Token.STRING value of the next token, consuming it.
Returns the type of the next token without consuming it.
Reset the current object so that selectName start returning names again
An optimized way to retrieve the nextName when the candidates and their order is known. selectName maintains the current index in the list and saves having to string compare nextName to every candidate.