Show / Hide Table of Contents

Class PortableObjectSerializer

IPofSerializer implementation that supports the serialization and deserialization of any class that implements IPortableObject to and from a POF stream.

Inheritance
object
PortableObjectSerializer
Implements
IPofSerializer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Tangosol.IO.Pof
Assembly: Coherence.dll
Syntax
public class PortableObjectSerializer : IPofSerializer

Constructors

PortableObjectSerializer(int)

Create a new PortableObjectSerializer for the user type with the given type identifier.

Declaration
public PortableObjectSerializer(int typeId)
Parameters
Type Name Description
int typeId

The user type identifier.

Fields

m_typeId

The type identifier of the user type to serialize and deserialize.

Declaration
protected int m_typeId
Field Value
Type Description
int

Methods

Deserialize(IPofReader)

Deserialize a user type instance from a POF stream by reading its state using the specified IPofReader object.

Declaration
public virtual 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:

  1. If the object is evolvable, the implementation must get the version by calling VersionId.
  2. 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.
  3. 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.

Initialize(IPortableObject, IPofReader)

Initialize the specified (newly instantiated) PortableObject instance using the specified reader.

Declaration
public void Initialize(IPortableObject portable, IPofReader reader)
Parameters
Type Name Description
IPortableObject portable

The object to initialize.

IPofReader reader

The PofReader with which to read the object's state.

Serialize(IPofWriter, object)

Serialize a user type instance to a POF stream by writing its state using the specified IPofWriter object.

Declaration
public virtual 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:

  1. If the object is evolvable, the implementation must set the version by calling VersionId.
  2. 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.
  3. 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.

Implements

IPofSerializer
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.