Class FieldSerializer
java.lang.Object
com.jme3.network.serializing.Serializer
com.jme3.network.serializing.serializers.FieldSerializer
The field serializer is the default serializer used for custom class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckClass(Class clazz) voidinitialize(Class clazz) Registration for when a serializer may need to cache something.<T> TreadObject(ByteBuffer data, Class<T> c) Read an object from the buffer, effectively deserializing it.voidwriteObject(ByteBuffer buffer, Object object) Write an object to the buffer, effectively serializing it.Methods inherited from class com.jme3.network.serializing.Serializer
getExactSerializer, getExactSerializerRegistration, getSerializer, getSerializer, getSerializerRegistration, getSerializerRegistration, getSerializerRegistrations, initialize, isReadOnly, readClass, readClassAndObject, registerClass, registerClass, registerClass, registerClasses, registerClassForId, registerPackage, setReadOnly, setStrictRegistration, writeClass, writeClassAndObject
-
Constructor Details
-
FieldSerializer
public FieldSerializer()
-
-
Method Details
-
checkClass
-
initialize
Description copied from class:SerializerRegistration for when a serializer may need to cache something. Override to use.- Overrides:
initializein classSerializer- Parameters:
clazz- The class that has been registered to the serializer.
-
readObject
Description copied from class:SerializerRead an object from the buffer, effectively deserializing it.- Specified by:
readObjectin classSerializer- Parameters:
data- The buffer to read from.c- The class of the object.- Returns:
- The object read.
- Throws:
IOException- If deserializing fails.
-
writeObject
Description copied from class:SerializerWrite an object to the buffer, effectively serializing it.- Specified by:
writeObjectin classSerializer- Parameters:
buffer- The buffer to write to.object- The object to serialize.- Throws:
IOException- If serializing fails.
-