com.sibvisions.rad.remote
Class ByteSerializer

java.lang.Object
  extended by com.sibvisions.rad.remote.ByteSerializer
All Implemented Interfaces:
ISerializer

public final class ByteSerializer
extends Object
implements ISerializer

The ByteSerializer converts an object state into a byte stream in such a way that the byte stream can be converted back into a copy of the object. For simple types, the conversion is not VM dependent, e.g. serialization can be done with jdk 1.3 and deserialization can be done with jdk 1.5.

All complex types are serialized via VM serialization mode.

See Also:
ISerializer

Constructor Summary
ByteSerializer()
          Creates a new instance of ByteSerializer.
 
Method Summary
 Object read(DataInputStream pIn)
          Reads in an object from a serialized DataInputStream.
 void write(DataOutputStream pOut, Object pObject)
          Writes a serialized object to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteSerializer

public ByteSerializer()
Creates a new instance of ByteSerializer.

Method Detail

write

public final void write(DataOutputStream pOut,
                        Object pObject)
                 throws Exception
Writes a serialized object to a stream.

Specified by:
write in interface ISerializer
Parameters:
pOut - output stream for the object
pObject - serializable object
Throws:
Exception - if serialization fails

read

public final Object read(DataInputStream pIn)
                  throws Exception
Reads in an object from a serialized DataInputStream.

Specified by:
read in interface ISerializer
Parameters:
pIn - serialized DataInputStream
Returns:
deserialized object
Throws:
Exception - if deserialization fails or if the object type is TYPE_OBJECT and the object cannot be read


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.