org.ow2.jonas.lib.ejb21
Class MarshallTool
java.lang.Object
org.ow2.jonas.lib.ejb21.MarshallTool
public class MarshallTool
- extends Object
Contains static methods to marshall/unmarshall objects to/from a byte[]
- Author:
- Vincent Trussart (vincent@linuxfreak.com) : Initial developer, Helene Joanin
Method Summary |
static Serializable |
fromBytes(byte[] bytes)
Converts byte array to an instance of java.io.Serializable |
static byte[] |
toBytes(Serializable o)
Converts an instance of java.io.Serializable to a serialized byte array |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MarshallTool
public MarshallTool()
toBytes
public static byte[] toBytes(Serializable o)
throws IOException
- Converts an instance of java.io.Serializable to a serialized byte array
- Parameters:
o
- Object to serialize
- Returns:
- byte array containing the serialization of the Serializable object
- Throws:
IOException
- in error case
fromBytes
public static Serializable fromBytes(byte[] bytes)
throws IOException,
ClassNotFoundException
- Converts byte array to an instance of java.io.Serializable
- Parameters:
bytes
- A byte array containing the a serialized object
- Returns:
- the unmarshalled object
- Throws:
IOException
- in error case
ClassNotFoundException
- in error case
Copyright © 2010 OW2 Consortium. All Rights Reserved.