org.objectweb.telosys.util.serial
Class MemorySerializer

java.lang.Object
  extended byorg.objectweb.telosys.util.serial.MemorySerializer

public class MemorySerializer
extends java.lang.Object


Constructor Summary
MemorySerializer()
           
 
Method Summary
 java.lang.Object read()
          Read the object from the bytes array produced by the last 'write' operation
( returns the last object serialized by this serializer)
 java.lang.Object read(byte[] serializedObject)
          Read the object from the given bytes array
 byte[] write(java.lang.Object obj)
          Writes (serializes) the given object "in memory" and returns the result as an array of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemorySerializer

public MemorySerializer()
Method Detail

write

public byte[] write(java.lang.Object obj)
             throws TelosysException
Writes (serializes) the given object "in memory" and returns the result as an array of bytes.
The result is kept, and can be retrieve with the 'read' method without parameter

Parameters:
obj -
Returns:
Throws:
TelosysException

read

public java.lang.Object read()
                      throws TelosysException
Read the object from the bytes array produced by the last 'write' operation
( returns the last object serialized by this serializer)

Returns:
Throws:
TelosysException

read

public java.lang.Object read(byte[] serializedObject)
                      throws TelosysException
Read the object from the given bytes array

Parameters:
serializedObject -
Returns:
Throws:
TelosysException