Package org.jcsp.net

Class SerializedObject

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    class SerializedObject
    extends java.lang.Object
    implements java.io.Externalizable
    • Field Detail

      • serializedData

        private byte[] serializedData
      • objectToString

        private java.lang.String objectToString
    • Constructor Detail

      • SerializedObject

        public SerializedObject​(java.lang.Object obj,
                                boolean storeToString)
                         throws java.io.NotSerializableException,
                                java.io.IOException
        This is the public used constructor. It takes an object and attempts to serialize it.
        Throws:
        java.io.NotSerializableException - If obj is not Serializable.
        java.io.IOException - if an IO error occurs during Serialization, should not happen unless there is a bug.
      • SerializedObject

        SerializedObject​(byte[] data,
                         java.lang.String objectToString)
        A private constructor used during the deserialization process of this object. Externalizable objects require a no-arg constructor so a replacement object is serialized in this object's place. On deserialization, this object is reconstructed using this constructor.
        Parameters:
        data - a byte[] containing the serialized data of the object that this object is holding.
        objectToString - The toString value of the stored object.
    • Method Detail

      • getSerializedData

        public byte[] getSerializedData()
      • get

        public java.lang.Object get()
                             throws java.lang.ClassNotFoundException,
                                    java.io.IOException
        Throws:
        java.lang.ClassNotFoundException
        java.io.IOException
      • get

        public java.lang.Object get​(SerializedObject.InputStreamFactory factory)
                             throws java.lang.ClassNotFoundException,
                                    java.io.IOException
        Throws:
        java.lang.ClassNotFoundException
        java.io.IOException
      • getObjectToString

        public java.lang.String getObjectToString()
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeReplace

        public java.lang.Object writeReplace()
                                      throws java.io.ObjectStreamException
        Throws:
        java.io.ObjectStreamException