BufferedSourceJsonReader

class BufferedSourceJsonReader(source: BufferedSource) : JsonReader

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

BufferedSourceJsonReader
Link copied to clipboard
common
fun BufferedSourceJsonReader(source: BufferedSource)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

beginArray
Link copied to clipboard
common
open override fun beginArray(): JsonReader
Consumes the next token from the JSON stream and asserts that it is the beginning of a new array.
beginObject
Link copied to clipboard
common
open override fun beginObject(): JsonReader
Consumes the next token from the JSON stream and asserts that it is the beginning of a new object.
close
Link copied to clipboard
common
open override fun close()
endArray
Link copied to clipboard
common
open override fun endArray(): JsonReader
Consumes the next token from the JSON stream and asserts that it is the end of the current array.
endObject
Link copied to clipboard
common
open override fun endObject(): JsonReader
Consumes the next token from the JSON stream and asserts that it is the end of the current object.
hasNext
Link copied to clipboard
common
open override fun hasNext(): Boolean
Returns true if the current array or object has another element.
nextBoolean
Link copied to clipboard
common
open override fun nextBoolean(): Boolean
Returns the Token.
nextDouble
Link copied to clipboard
common
open override fun nextDouble(): Double
Returns the Token.
nextInt
Link copied to clipboard
common
open override fun nextInt(): Int
Returns the Token.
nextLong
Link copied to clipboard
common
open override fun nextLong(): Long
Returns the Token.
nextName
Link copied to clipboard
common
open override fun nextName(): String
Returns the next token Token.
nextNull
Link copied to clipboard
common
open override fun nextNull(): Nothing?
Consumes the next token from the JSON stream and asserts that it is a literal null.
nextNumber
Link copied to clipboard
common
open override fun nextNumber(): JsonNumber
Returns the Token.
nextString
Link copied to clipboard
common
open override fun nextString(): String?
Returns the Token.
peek
Link copied to clipboard
common
open override fun peek(): JsonReader.Token
Returns the type of the next token without consuming it.
rewind
Link copied to clipboard
common
open override fun rewind()
Reset the current object so that selectName start returning names again
selectName
Link copied to clipboard
common
open override fun selectName(names: List<String>): Int
An optimized way to retrieve the nextName when the candidates and their order is known.
skipValue
Link copied to clipboard
common
open override fun skipValue()
Skips the next value recursively.