Class 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 and Soap transports to serialize/deserialize CASSerializer objects or CASCompleteSerializer objects (includes type system and index definitions) or (for SOAP) arbitrary objects This class is abstract only to prevent instantiation. All the methods are static.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SerializationUtils

        public SerializationUtils()
    • 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. If aObject is null, 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 from aBytes. If aBytes is null, null is returned.
        Throws:
        java.io.IOException - if an I/O error occurs
        java.lang.ClassNotFoundException - if a required class could not be found