class util::JsonOutStream

sys::Obj
  sys::OutStream
    util::JsonOutStream

@Js

Source

JsonOutStream writes objects in Javascript Object Notation (JSON).

See pod doc for details.

escapeUnicode

Bool escapeUnicode := true

Source

Flag to escape characters over 0x7f using \uXXXX

make

new make(OutStream out)

Source

Construct by wrapping given output stream.

prettyPrint

Bool prettyPrint := false

Source

Write JSON in pretty-printed format. This format produces more readable JSON at the expense of larger output size.

prettyPrintToStr

static Str prettyPrintToStr(Obj? obj)

Source

Convenience for pretty-printing JSON to an in-memory string.

writeJson

This writeJson(Obj? obj)

Source

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)
writeJsonToStr

static Str writeJsonToStr(Obj? obj)

Source

Convenience for writeJson to an in-memory string.