Methods
-
<inner> Deserialize(content) → {T}
-
Deserializes an array of bytes back to an object.
Any array of bytes should lead to either a non
null
value or throw.The output must be consistent, an identical output should be returned if called twice on the identical arrays.
Parameters:
Name Type Description content
external:ArrayBuffer the array of bytes representing an object. Throws:
-
in case the buffer cannot be read.
- Type
- external:Error
Returns:
the object deserialized from the array of bytes.- Type
- T
-
-
<inner> Serialize(item) → {external:ArrayBuffer}
-
Serializes objects to arrays of bytes.
Any instance of
T
must be accepted and have a nonnull
return value: for anyo
,o instanceof T
impliesserialize(o) != null
.The output must be consistent, an identical output should be returned if called twice on the equal objects.
Parameters:
Name Type Description item
T the item to serialize. Returns:
the serialized item.- Type
- external:ArrayBuffer