Class FSTClassSerializer

java.lang.Object
org.nustaq.serialization.FSTBasicObjectSerializer
org.nustaq.serialization.serializers.FSTClassSerializer
All Implemented Interfaces:
FSTCrossPlatformSerialzer, FSTObjectSerializer

public class FSTClassSerializer
extends FSTBasicObjectSerializer
Date: 02.06.13 Time: 16:51 To change this template use File | Settings | File Templates.
  • Constructor Details

  • Method Details

    • writeObject

      public void writeObject​(FSTObjectOutput out, java.lang.Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws java.io.IOException
      Description copied from interface: FSTObjectSerializer
      write the contents of a given object
      Throws:
      java.io.IOException
    • instantiate

      public java.lang.Object instantiate​(java.lang.Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws java.lang.Exception
      Description copied from interface: FSTObjectSerializer
      return null to delegate object instantiation to FST. If you want to implement object instantiation yourself, usually you leave the readObject method empty and handle instantiation and reading the object here. You must call registerObjectForWrite immediately after creating it on the FSTObjectInput
      Specified by:
      instantiate in interface FSTObjectSerializer
      Overrides:
      instantiate in class FSTBasicObjectSerializer
      Throws:
      java.lang.Exception
    • alwaysCopy

      public boolean alwaysCopy()
      Specified by:
      alwaysCopy in interface FSTObjectSerializer
      Overrides:
      alwaysCopy in class FSTBasicObjectSerializer
      Returns:
      true if FST can skip a search for same instances in the serialized ObjectGraph. This speeds up reading and writing and makes sense for short immutable such as Integer, Short, Character, Date, .. . For those classes it is more expensive (CPU, size) to do a lookup than to just write the Object twice in case.