org.exolab.jms.tranlog
Class SerializationHelper
java.lang.Object
|
+--org.exolab.jms.tranlog.SerializationHelper
- public class SerializationHelper
- extends java.lang.Object
A utility class to assist with serialization and desearialization of objects
to and from byte stream
Method Summary |
static java.lang.Object |
deserialize(byte[] blob)
Deserialise the specified blob into an Object and return it
to the client. |
static byte[] |
serialize(java.lang.Object object)
Serialize the specified object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SerializationHelper
public SerializationHelper()
serialize
public static byte[] serialize(java.lang.Object object)
throws java.io.IOException
- Serialize the specified object
- Parameters:
object
- - object to serialize- Returns:
- byte[] - the serialized object
- Throws:
java.io.IOException
- - if there is an error with serialization
deserialize
public static java.lang.Object deserialize(byte[] blob)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Deserialise the specified blob into an Object and return it
to the client.
If there is an error with the deserialization then throw an
IOException
- Parameters:
blob
- - the blob of bytes to deserialize- Returns:
- Object - the object to return
- Throws:
java.io.IOException
- - if it cannot deseriliazejava.lang.IllegalArgumentException
- if the blob is null
Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.