com.bubble.serializer
Interface Deserializer


public interface Deserializer

Interface of the custom deserializers for each class.

Author:
Leonardo "Bubble" Mesquita

Method Summary
 void deserialize(java.lang.Object obj, java.nio.ByteBuffer buffer, DeserializationContext context)
          Reads the state of the object from the buffer.
 java.lang.Object instantiate(java.nio.ByteBuffer buffer, DeserializationContext context)
          Returns a new object, possibly reading instantiation information from the buffer.
 

Method Detail

instantiate

public java.lang.Object instantiate(java.nio.ByteBuffer buffer,
                                    DeserializationContext context)
Returns a new object, possibly reading instantiation information from the buffer. Currently, only arrays have instantiation information, namely the size of the array, serialized separately. This allows arrays to be created without resorting to reflection.

Parameters:
buffer - The buffer that may contain instantiation information.
context - The DeserializationContext that is reading the buffer. The context can interpret references to previously read objects that might be members of the object being read.
Returns:
A new object read from the buffer, but not complete.

deserialize

public void deserialize(java.lang.Object obj,
                        java.nio.ByteBuffer buffer,
                        DeserializationContext context)
Reads the state of the object from the buffer.

Parameters:
obj - The object for which the state is being read.
buffer - The buffer that contains the state of the object.
context - The DeserializationContext that is reading the buffer. The context can interpret references to previously read objects that might be members of the object being read.


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