Class: Serial

Serial

new Serial()

Serializer and deserializer interfaces.
Source:

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.
Source:
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 non null return value: for any o, o instanceof T implies serialize(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.
Source:
Returns:
the serialized item.
Type
external:ArrayBuffer