org.wamblee.general
Class ObjectSerializationUtils
java.lang.Object
org.wamblee.general.ObjectSerializationUtils
public class ObjectSerializationUtils
- extends Object
Utility for serializating and deserializing objects.
- Author:
- Erik Brakkee
|
Method Summary |
static
|
deserialize(byte[] aData,
Class<T> aType)
Desrializes an object from a byte array. |
static byte[] |
serialize(Object aObject)
Serialize an object to a byte array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectSerializationUtils
public ObjectSerializationUtils()
serialize
public static byte[] serialize(Object aObject)
throws IOException
- Serialize an object to a byte array.
- Parameters:
aObject - Object ot serialize.
- Returns:
- Byte array.
- Throws:
IOException
deserialize
public static <T> T deserialize(byte[] aData,
Class<T> aType)
throws IOException,
ClassNotFoundException
- Desrializes an object from a byte array.
- Type Parameters:
T - Type of the object.- Parameters:
aData - Serialized data.aType - Type of the object.
- Returns:
- Object.
- Throws:
IOException
ClassNotFoundException
Copyright © 2011. All Rights Reserved.