Class FieldSerializer

java.lang.Object
com.jme3.network.serializing.Serializer
com.jme3.network.serializing.serializers.FieldSerializer

public class FieldSerializer extends Serializer
The field serializer is the default serializer used for custom class.
  • Constructor Details

    • FieldSerializer

      public FieldSerializer()
  • Method Details

    • checkClass

      protected void checkClass(Class clazz)
    • initialize

      public void initialize(Class clazz)
      Description copied from class: Serializer
      Registration for when a serializer may need to cache something. Override to use.
      Overrides:
      initialize in class Serializer
      Parameters:
      clazz - The class that has been registered to the serializer.
    • readObject

      public <T> T readObject(ByteBuffer data, Class<T> c) throws IOException
      Description copied from class: Serializer
      Read an object from the buffer, effectively deserializing it.
      Specified by:
      readObject in class Serializer
      Parameters:
      data - The buffer to read from.
      c - The class of the object.
      Returns:
      The object read.
      Throws:
      IOException - If deserializing fails.
    • writeObject

      public void writeObject(ByteBuffer buffer, Object object) throws IOException
      Description copied from class: Serializer
      Write an object to the buffer, effectively serializing it.
      Specified by:
      writeObject in class Serializer
      Parameters:
      buffer - The buffer to write to.
      object - The object to serialize.
      Throws:
      IOException - If serializing fails.