Class DeserializationContext

  extended bycom.bubble.serializer.DeserializationContext

public class DeserializationContext
extends java.lang.Object

The DeserializationContext allows Objects and object graphs that were serialized by a SerializationContext to be read from a ByteBuffer.

The function of the context is to keep track of objects and class data that have already been read, allowing the data to contain simple references to other objects. This allows, for instance, the serialization of objects graphs that contains cycles.

Only objects that implement can be read by a DeserializationContext. Currently, custom deserialization (through or readObject method) as well as other advanced serialization features are not supported.

The data in the ByteBuffer is not self-contained, because it may refer to objects or classes that have been previously read. Because of that, data written with a single SerializationContext should be read by a single DeserializationContext.

Leonardo "Bubble" Mesquita
See Also:
ByteBuffer, Serializable, SerializationContext

Constructor Summary
          Constructs a new DeserializationContext.
Method Summary
 java.lang.Object deserialize(java.nio.ByteBuffer buffer)
          Reads an object from a ByteBuffer.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DeserializationContext()
Constructs a new DeserializationContext.

Method Detail


public java.lang.Object deserialize(java.nio.ByteBuffer buffer)
Reads an object from a ByteBuffer. The object must have been transformed to serial form by a SerializationContext. The data can be a reference to an object that was previosly read by this DeserializationContext.

buffer - The buffer that contains the object data.
The reconstructed object.

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