Class SerializedObject
java.lang.Object
org.jcsp.net.SerializedObject
- All Implemented Interfaces:
Externalizable, Serializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classThis class exists purely for performance reasons.private classprivate static classThis class exists because the main class cannot have a no-arg constructor as required by externalizable.static interface -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSerializedObject(byte[] data, String objectToString) A private constructor used during the deserialization process of this object.SerializedObject(Object obj, boolean storeToString) This is the public used constructor. -
Method Summary
Modifier and TypeMethodDescriptionget()get(SerializedObject.InputStreamFactory factory) byte[]voidvoid
-
Field Details
-
serializedData
private byte[] serializedData -
objectToString
-
-
Constructor Details
-
SerializedObject
public SerializedObject(Object obj, boolean storeToString) throws NotSerializableException, IOException This is the public used constructor. It takes an object and attempts to serialize it.- Throws:
NotSerializableException- If obj is not Serializable.IOException- if an IO error occurs during Serialization, should not happen unless there is a bug.
-
SerializedObject
SerializedObject(byte[] data, 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 Details
-
getSerializedData
public byte[] getSerializedData() -
get
- Throws:
ClassNotFoundExceptionIOException
-
get
public Object get(SerializedObject.InputStreamFactory factory) throws ClassNotFoundException, IOException - Throws:
ClassNotFoundExceptionIOException
-
getObjectToString
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
writeReplace
- Throws:
ObjectStreamException
-