Package org.apache.uima.internal.util
Class SerializationUtils
- java.lang.Object
-
- org.apache.uima.internal.util.SerializationUtils
-
public abstract class SerializationUtils extends java.lang.Object
Serialize and Deserialize arbitrary objects to/from byte arrays, using standard Java object serialization/deserialization support. Used in the Vinci transport to serialize/deserialize CASSerializer objects or CASCompleteSerializer objects (includes type system and index definitions). This class is abstract only to prevent instantiation. All the methods are static.
-
-
Constructor Summary
Constructors Constructor Description SerializationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Object
deserialize(byte[] aBytes)
Deserializes an object from a byte array.static byte[]
serialize(java.io.Serializable aObject)
Serializes an object to a byte array.
-
-
-
Method Detail
-
serialize
public static byte[] serialize(java.io.Serializable aObject) throws java.io.IOException
Serializes an object to a byte array.- Parameters:
aObject
- object to serialize- Returns:
aObject
encoded as a byte array. IfaObject
isnull
,null
is returned.- Throws:
java.io.IOException
- if an I/O error occurs
-
deserialize
public static java.lang.Object deserialize(byte[] aBytes) throws java.io.IOException, java.lang.ClassNotFoundException
Deserializes an object from a byte array.- Parameters:
aBytes
- byte array to read from- Returns:
- The
Object
deserialized fromaBytes
. IfaBytes
isnull
,null
is returned. - Throws:
java.io.IOException
- if an I/O error occursjava.lang.ClassNotFoundException
- if a required class could not be found
-
-