classafPickle::Pickle
sys::Obj afPickle::Pickle
@Js
Pickles Fantom objects to and from strings.
- readObj
static Obj? readObj(Str? str, [Str:Obj]? options := null)Read a pickled object from a string according to the Fantom serialization format.
Options may contain:
"makeArgs"-Obj[]- args to pass to the root object's ctor. Default isnull."makeObjFn"-|Type type, Field:Obj? fieldVals->Obj?|- object creation func. Default isnull.
See docs for a full explanation of all options.
- readObjFromIn
static Obj? readObjFromIn(InStream? in, [Str:Obj]? options := null)A stream version of readObj().
- writeObj
static Str writeObj(Obj? obj, [Str:Obj]? options := null)Pickles an object to a string according to the Fantom serialization format.
The options may be used to specify the format of the output:
"indent"-IntorStr- num of spaces to indent, or the actual indent. Default is"\t".- "skipDefaults" -
Bool- skip fields with default values. Default isfalse. - "skipErrors" -
Bool- skip objects which aren't serializable. Default isfalse. - "using" -
Str[]- List of pod names to emit in using statements,["using":["sys", "afPickle"]]Default isnull.
See docs for a full explanation of all options.
- writeObjToOut
static Void writeObjToOut(OutStream out, Obj? obj, [Str:Obj]? options := null)A stream version of writeObj().