Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


com.tangosol.io.pof
Interface PofSerializer

All Known Implementing Classes:
ExternalizableLitePofSerializer, ExternalizablePofSerializer, PortableObjectSerializer, PrincipalPofSerializer, SafeConfigurablePofContext.JavaPofSerializer, SafeConfigurablePofContext.SafePofSerializer, SubjectPofSerializer, ThrowablePofSerializer, XmlSerializablePofSerializer

public interface PofSerializer

The PofSerializer interface provides the capability of reading and writing a Java object from and to a POF stream. <p/> In order to support hot-deploying containers, it is important in the case of a PofSerializer implementation that requires ClassLoader context that it not hold any strong references to that ClassLoader, or to any Class objects obtained from that ClassLoader.

Since:
Coherence 3.2
Author:
cp/jh 2007.07.14
See Also:
PofReader, PofWriter

Method Summary
 java.lang.Object deserialize(PofReader in)
          Deserialize a user type instance from a POF stream by reading its state using the specified PofReader object.
 void serialize(PofWriter out, java.lang.Object o)
          Serialize a user type instance to a POF stream by writing its state using the specified PofWriter object.

 

Method Detail

serialize

void serialize(PofWriter out,
               java.lang.Object o)
               throws java.io.IOException
Serialize a user type instance to a POF stream by writing its state using the specified PofWriter object. <p/> An implementation of PofSerializer 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 PofWriter.setVersionId(int).
  2. The implementation may write any combination of the properties of the user type by using the "write" methods of the PofWriter, 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 PofWriter.writeRemainder(com.tangosol.util.Binary).
Parameters:
out - the PofWriter with which to write the object's state
o - the object to serialize
Throws:
java.io.IOException - if an I/O error occurs

deserialize

java.lang.Object deserialize(PofReader in)
                             throws java.io.IOException
Deserialize a user type instance from a POF stream by reading its state using the specified PofReader object. <p/> An implementation of PofSerializer 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 PofWriter.getVersionId().
  2. The implementation may read any combination of the properties of the user type by using "read" methods of the PofReader, 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 PofReader.readRemainder().
Parameters:
in - the PofReader with which to read the object's state
Returns:
the deserialized user type instance
Throws:
java.io.IOException - if an I/O error occurs

Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


Copyright © 2000, 2009, Oracle. All rights reserved.