toJson

abstract fun toJson(writer: JsonWriter, @Nullable() value: T)

Encodes the given {@code value} with the given {@code writer}.

fun toJson(sink: BufferedSink, @Nullable() value: T)
fun toJson(@Nullable() value: T): String

Encodes the given {@code value} into a String and returns it.