Class FSTBigNumberSerializers.FSTShortSerializer
java.lang.Object
org.nustaq.serialization.FSTBasicObjectSerializer
org.nustaq.serialization.serializers.FSTBigNumberSerializers.FSTShortSerializer
- All Implemented Interfaces:
FSTCrossPlatformSerialzer
,FSTObjectSerializer
- Enclosing class:
- FSTBigNumberSerializers
-
Field Summary
Fields inherited from interface org.nustaq.serialization.FSTObjectSerializer
REALLY_NULL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
instantiate
(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) return null to delegate object instantiation to FST.void
writeObject
(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) write the contents of a given objectboolean
Methods inherited from class org.nustaq.serialization.FSTBasicObjectSerializer
readObject, willHandleClass
-
Constructor Details
-
FSTShortSerializer
public FSTShortSerializer()
-
-
Method Details
-
writeObject
public void writeObject(FSTObjectOutput out, Object toWrite, FSTClazzInfo clzInfo, FSTClazzInfo.FSTFieldInfo referencedBy, int streamPosition) throws IOException Description copied from interface:FSTObjectSerializer
write the contents of a given object- Throws:
IOException
-
instantiate
public Object instantiate(Class objectClass, FSTObjectInput in, FSTClazzInfo serializationInfo, FSTClazzInfo.FSTFieldInfo referencee, int streamPosition) throws 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 interfaceFSTObjectSerializer
- Overrides:
instantiate
in classFSTBasicObjectSerializer
- Throws:
Exception
-
alwaysCopy
public boolean alwaysCopy()- Specified by:
alwaysCopy
in interfaceFSTObjectSerializer
- Overrides:
alwaysCopy
in classFSTBasicObjectSerializer
- 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.
-
writeTupleEnd
public boolean writeTupleEnd()- Specified by:
writeTupleEnd
in interfaceFSTCrossPlatformSerialzer
- Overrides:
writeTupleEnd
in classFSTBasicObjectSerializer
-