|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
Deserializer | Interface of the custom deserializers for each class. |
Serializer | Interface of the custom serializers for each class. |
Class Summary | |
DeserializationContext | The DeserializationContext allows Objects and object graphs that were serialized by a SerializationContext to be read from a ByteBuffer. |
DeserializationContextTest | |
FieldResolver | |
Generator | Generates customized code for serialization. |
GeneratorTest | |
SerializationContext | The SerializationContext allows Objects and object graphs to be written to a ByteBuffer in serialized form. |
SerializationContextTest | |
SerializationTest | |
SerializationTestSuite | |
ShortArrayTest |
Exception Summary | |
BufferCorruptedException | |
FieldResolutionException | |
GeneratorRuntimeException |
Faster Java Serialization classes.
The classes in this package enable faster serialization by generating bytecodes on the fly to serialize objects.
When an object is serialized, its class is inspected and a class that implements the Serializer interface is generated. This class is tailor made to serialize the fields of the given object's class directly.
To serialize objects to a ByteBuffer, all you have to do is
use the SerializationContext
class:
... SerializationContext context = new SerializationContext(); ByteBuffer buffer = ByteBuffer.allocate(1024); context.serialize(myObject, buffer); ...
Serializes myObject
. Note that, in order to be
serialized, objects must implement java.io.Serializable
To reconstruct the object, all you have to do is use the
DeserializationContext
class:
... DeserializationContext context = new DeserializationContext(); MyObject reconstructedObject = (MyObject)context.deserialize(buffer); ...
Reads the reconstructedObject
. In the meantime, the data
in the ByteBuffer can easily be written to a file or sent through a network
using Java NIO.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |