class SerializedObject
extends java.lang.Object
implements java.io.Externalizable
| Modifier and Type | Class and Description |
|---|---|
private static class |
SerializedObject.AccesibleByteArrayOutputStream
This class exists purely for performance reasons.
|
private class |
SerializedObject.BasicInputStreamFactory |
private static class |
SerializedObject.ExtClass
This class exists because the main class cannot have a no-arg
constructor as required by externalizable.
|
static interface |
SerializedObject.InputStreamFactory |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
objectToString |
private byte[] |
serializedData |
| Constructor and Description |
|---|
SerializedObject(byte[] data,
java.lang.String objectToString)
A private constructor used during the deserialization process of this
object.
|
SerializedObject(java.lang.Object obj,
boolean storeToString)
This is the public used constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get() |
java.lang.Object |
get(SerializedObject.InputStreamFactory factory) |
java.lang.String |
getObjectToString() |
byte[] |
getSerializedData() |
void |
readExternal(java.io.ObjectInput in) |
void |
writeExternal(java.io.ObjectOutput out) |
java.lang.Object |
writeReplace() |
private byte[] serializedData
private java.lang.String objectToString
public SerializedObject(java.lang.Object obj,
boolean storeToString)
throws java.io.NotSerializableException,
java.io.IOException
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(byte[] data,
java.lang.String objectToString)
data - a byte[] containing the serialized data of the object
that this object is holding.objectToString - The toString value of the stored object.public byte[] getSerializedData()
public java.lang.Object get()
throws java.lang.ClassNotFoundException,
java.io.IOException
java.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic java.lang.Object get(SerializedObject.InputStreamFactory factory) throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic java.lang.String getObjectToString()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.Object writeReplace()
throws java.io.ObjectStreamException
java.io.ObjectStreamException