10.8.1 Serialization format
Each supported value is translated to a distinct prefix character, followed by the necessary data.
null:nInt:zfor zero, orifollowed by the integer display (e.g.i456)Float:NaN:k- negative infinity:
m - positive infinity:
p - finite floats:
dfollowed by the float display (e.g.d1.45e-8)
Bool:tfortrue,fforfalseString:yfollowed by the url encoded string length, then:and the url encoded string (e.g.y10:hi%20there for "hi there".- name-value pairs: a serialized string representing the name followed by the serialized value
- structure:
ofollowed by the list of name-value pairs and terminated byg(e.g.oy1:xi2y1:kngfor{x:2, k:null}) List:lfollowed by the list of serialized items, followed byh(e.g.lnnhfor a list of twonullvalues)Array:afollowed by the list of serialized items, followed byh. For multiple consecutivenullvalues,ufollowed by the number ofnullvalues is used (e.g.ai1i2u4i7ni9h for [1,2,null,null,null,null,7,null,9])Date:vfollowed by the date itself (e.g.v2010-01-01 12:45:10)haxe.ds.StringMap:bfollowed by the name-value pairs, followed byh(e.g.by1:xi2y1:knhfor{"x" => 2, "k" => null})haxe.ds.IntMap:qfollowed by the key-value pairs, followed byh. Each key is represented as:<int>(e.g.q:4n:5i45:6i7hfor{4 => null, 5 => 45, 6 => 7})haxe.ds.ObjectMap:Mfollowed by serialized value pairs representing the key and value, followed byhhaxe.io.Bytes:sfollowed by the length of the base64 encoded bytes, then:and the byte representation using the codesA-Za-z0-9%(e.g.s3:AAAfor 2 bytes equal to0, ands10:SGVsbG8gIQforhaxe.io.Bytes.ofString("Hello !"))- exception:
xfollowed by the exception value - class instance:
cfollowed by the serialized class name, followed by the name-value pairs of the fields, followed byg(e.g.cy5:Pointy1:xzy1:yzgfornew Point(0, 0)(having two integer fieldsxandy) - enum instance (by name):
wfollowed by the serialized enum name, followed by the serialized constructor name, followed by:, followed by the number of arguments, followed by the argument values (e.g.wy3:Fooy1:A:0forFoo.A(with no arguments),wy3:Fooy1:B:2i4nforFoo.B(4,null)) - enum instance (by index):
jfollowed by the serialized enum name, followed by:, followed by the constructor index (starting from 0), followed by:, followed by the number of arguments, followed by the argument values (e.g.jy3:Foo:0:0forFoo.A(with no arguments),jy3:Foo:1:2i4nforFoo.B(4,null)) cache references:
String:Rfollowed by the corresponding index in the string cache (e.g.R456)- class, enum or structure
rfollowed by the corresponding index in the object cache (e.g.r42)
custom:
Cfollowed by the class name, followed by the custom serialized data, followed bygCached elements and enum constructors are indexed from zero.