Interface IPofSerializer
The IPofSerializer interface provides the capability of reading and writing a .NET object from and to a POF stream.
Namespace: Tangosol.IO.Pof
Assembly: Coherence.dll
Syntax
public interface IPofSerializer
Methods
Deserialize(IPofReader)
Deserialize a user type instance from a POF stream by reading its state using the specified IPofReader object.
Declaration
object Deserialize(IPofReader reader)
Parameters
Type | Name | Description |
---|---|---|
IPofReader | reader | The IPofReader with which to read the object's state. |
Returns
Type | Description |
---|---|
object | The deserialized user type instance. |
Remarks
An implementation of IPofSerializer is required to follow the following steps in sequence for reading in an object of a user type:
- If the object is evolvable, the implementation must get the version by calling VersionId.
- The implementation may read any combination of the properties of the user type by using "read" methods of the IPofReader, but it must do so in the order of the property indexes. Additionally, the implementation must call {@link IPofReader#RegisterIdentity} with the new instance prior to reading any properties which are user type instances themselves.
- After all desired properties of the user type have been read, the implementation must terminate the reading of the user type by calling ReadRemainder().
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
Serialize(IPofWriter, object)
Serialize a user type instance to a POF stream by writing its state using the specified IPofWriter object.
Declaration
void Serialize(IPofWriter writer, object o)
Parameters
Type | Name | Description |
---|---|---|
IPofWriter | writer | The IPofWriter with which to write the object's state. |
object | o | The object to serialize. |
Remarks
An implementation of IPofSerializer is required to follow the following steps in sequence for writing out an object of a user type:
- If the object is evolvable, the implementation must set the version by calling VersionId.
- The implementation may write any combination of the properties of the user type by using the "write" methods of the IPofWriter, but it must do so in the order of the property indexes.
- After all desired properties of the user type have been written, the implementation must terminate the writing of the user type by calling WriteRemainder(Binary).
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |