Class SerializationUtils

java.lang.Object
org.apache.uima.internal.util.SerializationUtils

public abstract class SerializationUtils extends 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 Details

    • SerializationUtils

      public SerializationUtils()
  • Method Details

    • serialize

      public static byte[] serialize(Serializable aObject) throws IOException
      Serializes an object to a byte array.
      Parameters:
      aObject - object to serialize
      Returns:
      aObject encoded as a byte array. If aObject is null, null is returned.
      Throws:
      IOException - if an I/O error occurs
    • deserialize

      public static Object deserialize(byte[] aBytes) throws IOException, ClassNotFoundException
      Deserializes an object from a byte array.
      Parameters:
      aBytes - byte array to read from
      Returns:
      The Object deserialized from aBytes. If aBytes is null, null is returned.
      Throws:
      IOException - if an I/O error occurs
      ClassNotFoundException - if a required class could not be found