JsonStream

open class JsonStream : JsonWriter

Constructors

Link copied to clipboard
constructor(@NonNull out: Writer)
Constructs a JSONStream

Types

Link copied to clipboard
interface Streamable

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open fun beginArray(): JsonWriter
Begins encoding a new array.
Link copied to clipboard
open fun beginObject(): JsonWriter
Begins encoding a new object.
Link copied to clipboard
open fun close()
Flushes and closes this writer and the underlying Writer.
abstract fun close()
Link copied to clipboard
open fun endArray(): JsonWriter
Ends encoding the current array.
Link copied to clipboard
open fun endObject(): JsonWriter
Ends encoding the current object.
Link copied to clipboard
open fun flush()
Ensures all buffered data is written to the underlying Writer and flushes that writer.
abstract fun flush()
Link copied to clipboard
Returns true if this writer writes JSON that's safe for inclusion in HTML and XML documents.
Link copied to clipboard
open fun isLenient(): Boolean
Returns true if this writer has relaxed syntax rules.
Link copied to clipboard
open fun jsonValue(value: String): JsonWriter
Writes value directly to the writer without quoting or escaping.
Link copied to clipboard
Encodes the property name.
Link copied to clipboard
open fun nullValue(): JsonWriter
Encodes null.
Link copied to clipboard
fun setHtmlSafe(htmlSafe: Boolean)
Configure this writer to emit JSON that's safe for direct inclusion in HTML and XML documents.
Link copied to clipboard
fun setIndent(indent: String)
Sets the indentation string to be repeated for each level of indentation in the encoded document.
Link copied to clipboard
fun setLenient(lenient: Boolean)
Configure this writer to relax its syntax rules.
Link copied to clipboard
open fun value(@NonNull file: File)
Writes a File (its content) into the stream
open fun value(@Nullable object: Any)
open fun value(@Nullable object: Any, shouldRedactKeys: Boolean)
Serialises an arbitrary object as JSON, handling primitive types as well as Collections, Maps, and arrays.
open fun value(value: Boolean): JsonWriter
open fun value(value: Double): JsonWriter
open fun value(value: Boolean): JsonWriter
open fun value(value: Number): JsonWriter
open fun value(value: String): JsonWriter
open fun value(value: Long): JsonWriter
Encodes value.