value

abstract fun value(@Nullable() value: String): JsonWriter

Encodes {@code value}.

Return

this writer.

Parameters

value

the literal string value, or null to encode a null literal.

abstract fun value(value: Boolean): JsonWriter
abstract fun value(@Nullable() value: Boolean): JsonWriter
abstract fun value(value: Long): JsonWriter

Encodes {@code value}.

Return

this writer.

abstract fun value(value: Double): JsonWriter
abstract fun value(@Nullable() value: Number): JsonWriter

Encodes {@code value}.

Return

this writer.

Parameters

value

a finite value. May not be NaNs or infinities.

fun value(source: BufferedSource): JsonWriter

Writes {@code source} directly without encoding its contents. Equivalent to {@code try * (BufferedSink sink = writer.valueSink()) { source.readAll(sink): }}

See also

#valueSink()

#valueSink()