com.bubble.serializer
Interface Serializer


public interface Serializer

Interface of the custom serializers for each class.

Author:
Leonardo "Bubble" Mesquita

Method Summary
 void serialize(java.lang.Object obj, java.nio.ByteBuffer buffer, SerializationContext context)
          Serializes the object's fields.
 void serializeInstanceInfo(java.lang.Object obj, java.nio.ByteBuffer buffer, SerializationContext context)
          Serializes information necessary to instantiate an object.
 

Method Detail

serializeInstanceInfo

public void serializeInstanceInfo(java.lang.Object obj,
                                  java.nio.ByteBuffer buffer,
                                  SerializationContext context)
Serializes information necessary to instantiate an object. Currently, this is used only to serialize the size of arrays. In the future, we intend to use this to serialize the outer object instance of an inner class, in order to instantiate it without reflection.

Parameters:
obj - The object being serialized
buffer - The buffer to which the object is being serialized
context - The SerializationContext that is serializing this object. Objects that are members of the serialized object can be replaced by references by the context.

serialize

public void serialize(java.lang.Object obj,
                      java.nio.ByteBuffer buffer,
                      SerializationContext context)
Serializes the object's fields. Only non-final fields are serialized here, to reduce the amount of data that is sent through a SerializationContext.update(Object, ByteBuffer)

Parameters:
obj - The object being serialized
buffer - The buffer to which the object is being serialized
context - The SerializationContext that is serializing this object. Objects that are members of the serialized object can be replaced by references by the context.


Faster Java Serialization.
Copyright (C) 2006 Leonardo Bubble Mesquita.