ISerializable

Description

interface Tinman.Core.IO.Serialization.ISerializable

A class that supports serialization must implement this interface.

Every solid (i.e. non-abstract) class that implements the ISerializable interface must provide a public default constructor.

Public / Methods

Deserialize


public method Deserialize → (2)

serialVersion in : int32

The serial data version that has been used to write the object state, see SerialVersionWrite.

data in : ISerializer

[not-null]
The serial data stream.

returns → ISerializable

The deserialized object. This will typically be this, but in some circumstances, another instance may be returned (e.g. singletons).

Initializes the state of this object from the given data stream.

The Deserialize method will be called immediately after the object has been instantiated via its default constructor.

The provided serialVersion in number is guaranteed to be equal to or less than the SerialVersion returned by this object (i.e. ISerializable object must provide backwards compatibility).

IOException

If an I/O error has occurred.

Serialize


public method Serialize → (2)

serialVersion in : int32

The serial data version to use for writing the object state, as returned by SerialVersionWrite.

data in : ISerializer

[not-null]
The serial data stream.

Serializes the current state of this object to the given data stream.

IOException

If an I/O error has occurred.

Public / Attributes

Serial​Type


public attribute SerialType → (get)

value : ISerialTypeInfo

[not-null]
The serial type.

Returns the serial type of this object.

Serial​Version


public attribute SerialVersion → (get)

value : int32

[>=1]
The serial data version tag.

Returns the serial data version.

A ISerializable implementation is required to support all versions up to the one returned by SerialVersion.

Serial​Version​Write


public attribute SerialVersionWrite → (get)

value : int32

[1..ISerializable.SerialVersion]
The serial data version tag.

Returns the serial data version to use for the subsequent call to Serialize.

The default implementation returns SerialVersion. It may be overridden to write an older version, for backward compatibility.