writeObject

inline fun <R> writeObject(action: JSONWriter.() -> R): R

Write an object, using an action to supply the contents.

Return

The value, if any, returned by the action.

Parameters

R

The type of value, if any, returned by the action.

action

An action that writes the contents of an object.

Throws

If an I/O exception occurs.

If an object cannot be written.