HaysonWriter
@Js
class HaysonWriter : Obj
Write Haystack data in Hayson format, the JSON encoding where a typed scalar is an object naming its own kind.
Wrap output stream
Close the underlying output stream
Flush the underlying output stream and return this
Get a value as a Hayson string
Write the grid and return this
Write any haystack value
Bool close()
Close the underlying output stream
This flush()
Flush the underlying output stream and return this
new make(OutStream out, Dict? opts := null)
Wrap output stream.
HaysonWriter(out).writeVal(Etc.makeDict(["ts": DateTime.now])).close
The legacy Haystack 3 encoding is still written via the 'v3' option, but is deprecated and will be removed in a future version.
Dict : opts
static Str valToStr(Obj? val)
Get a value as a Hayson string.
virtual This writeGrid(Grid grid)
Write the grid and return this
This writeVal(Obj? val)
Write any haystack value