Package org.apache.uima.internal.util
Class SerializationUtils
java.lang.Object
org.apache.uima.internal.util.SerializationUtils
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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
deserialize
(byte[] aBytes) Deserializes a supported object from a byte array.static CASCompleteSerializer
deserializeCASCompleteSerializer
(byte[] aBytes) Deserializes aCASCompleteSerializer
from a byte array.static CASMgrSerializer
deserializeCASMgrSerializer
(byte[] aBytes) Deserializes aCASSerializer
from a byte array.static CASMgrSerializer
Deserializes aCASMgrSerializer
from anInputStream
.static CASSerializer
deserializeCASSerializer
(byte[] aBytes) Deserializes aCASSerializer
from a byte array.static Object
Deserializes aCASSerializer
orCASCompleteSerializer
from a byte array.static byte[]
serialize
(Serializable aObject) Serializes an object to a byte array.
-
Method Details
-
serialize
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:
IOException
- if an I/O error occurs
-
deserialize
Deserializes a supported object from a byte array. Supported objects areCASMgrSerializer
,CASSerializer
,CASCompleteSerializer
.- Parameters:
aBytes
- byte array to read from- Returns:
- The
Object
deserialized fromaBytes
. IfaBytes
isnull
,null
is returned. - Throws:
IOException
- if an I/O error occursClassNotFoundException
- if a required class could not be found
-
deserializeCASSerializerOrCASCompleteSerializer
public static Object deserializeCASSerializerOrCASCompleteSerializer(InputStream aIs) throws IOException Deserializes aCASSerializer
orCASCompleteSerializer
from a byte array.- Parameters:
aIs
- stream to read from- Returns:
- The
Object
deserialized fromaBytes
. IfaBytes
isnull
,null
is returned. - Throws:
IOException
- if an I/O error occurs
-
deserializeCASCompleteSerializer
public static CASCompleteSerializer deserializeCASCompleteSerializer(byte[] aBytes) throws IOException Deserializes aCASCompleteSerializer
from a byte array.- Parameters:
aBytes
- byte array to read from- Returns:
- The
Object
deserialized fromaBytes
. IfaBytes
isnull
,null
is returned. - Throws:
IOException
- if an I/O error occurs
-
deserializeCASSerializer
Deserializes aCASSerializer
from a byte array.- Parameters:
aBytes
- byte array to read from- Returns:
- The
Object
deserialized fromaBytes
. IfaBytes
isnull
,null
is returned. - Throws:
IOException
- if an I/O error occurs
-
deserializeCASMgrSerializer
Deserializes aCASSerializer
from a byte array.- Parameters:
aBytes
- byte array to read from- Returns:
- The
Object
deserialized fromaBytes
. IfaBytes
isnull
,null
is returned. - Throws:
IOException
- if an I/O error occurs
-
deserializeCASMgrSerializer
Deserializes aCASMgrSerializer
from anInputStream
.- Parameters:
aIn
- stream read from- Returns:
- The
Object
deserialized fromaBytes
. IfaBytes
isnull
,null
is returned. - Throws:
IOException
- if an I/O error occurs
-