JsonOutStream
@Js
class JsonOutStream : OutStream
JsonOutStream writes objects in Javascript Object Notation (JSON).
See pod doc for details.
Construct by wrapping given output stream
Write JSON in pretty-printed format
Flag to escape characters over 0x7f using \uXXXX
Convenience for pretty-printing JSON to an in-memory string
Convenience for writeJson to an in-memory string
Write the given object as JSON to this stream
Bool : escapeUnicode
Flag to escape characters over 0x7f using \uXXXX
new make(OutStream out)
Construct by wrapping given output stream.
Bool : prettyPrint
Write JSON in pretty-printed format. This format produces more readable JSON at the expense of larger output size.
static Str prettyPrintToStr(Obj? obj)
Convenience for pretty-printing JSON to an in-memory string.
This writeJson(Obj? obj)
Write the given object as JSON to this stream. The obj must be one of the follow:
- null
- Bool
- Num
- Str
- Str:Obj?
- Obj?[]
- simple (written as JSON string)
- serializable (written as JSON object)
static Str writeJsonToStr(Obj? obj)
Convenience for writeJson to an in-memory string.