As per the platform serialization rules, the object and all its non transient
dependencies have to implement the Serializable interface.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | copy(Object
the object to be copied object)Implements com. |
| private static <T> T |
| SERIALIZATION_COPIER_ERROR | back to summary |
|---|---|
| private static final String SERIALIZATION_COPIER_ERROR | |
| SerializationCopier | back to summary |
|---|---|
| public SerializationCopier() | |
| copy | back to summary |
|---|---|
| public Object copy(Object object) Implements com. Doc from com. Return an object that's logically a copy of the given object.
| |
| copyOutIn | back to summary |
|---|---|
private static <T> T copyOutIn(T object) throws ClassNotFoundException, IOException
| |
| Modifier and Type | Field and Description |
|---|---|
| private final SerializationCopier. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected Class | resolveClass(ObjectStreamClass
an instance of class objectStreamClass)ObjectStreamClassOverrides java. |
| protected Class | resolveProxyClass(String[]
the list of interface names that were
deserialized in the proxy class descriptor interfaceNames)Overrides java. |
| out | back to summary |
|---|---|
| private final SerializationCopier. | |
| In | back to summary |
|---|---|
| pack-priv In(InputStream inputStream, SerializationCopier. | |
| resolveClass | back to summary |
|---|---|
| protected Class Overrides java. Doc from java. Load the local class equivalent of the specified stream class description. Subclasses may implement this method to allow classes to be fetched from an alternate source. The corresponding method in The default implementation of this method in
Class.forName(desc.getName(), false, loader) loader is the first class loader on the current
thread's stack (starting from the currently executing method) that is
neither the platform
class loader nor its ancestor; otherwise, loader is the
platform class loader. If this call results in a
ClassNotFoundException and the name of the passed
ObjectStreamClass instance is the Java language keyword
for a primitive type or void, then the Class object
representing that primitive type or void will be returned
(e.g., an ObjectStreamClass with the name
"int" will be resolved to Integer.TYPE).
Otherwise, the ClassNotFoundException will be thrown to
the caller of this method.
| |
| resolveProxyClass | back to summary |
|---|---|
| protected Class Overrides java. Doc from java. Returns a proxy class that implements the interfaces named in a proxy class descriptor; subclasses may implement this method to read custom data from the stream along with the descriptors for dynamic proxy classes, allowing them to use an alternate loading mechanism for the interfaces and the proxy class. This method is called exactly once for each unique proxy class descriptor in the stream. The corresponding method in The default implementation of this method in
Class.forName(i, false, loader) loader is the first class loader on the current
thread's stack (starting from the currently executing method) that is
neither the platform
class loader nor its ancestor; otherwise, loader is the
platform class loader.
Unless any of the resolved interfaces are non-public, this same value
of loader is also the class loader passed to
Proxy.getProxyClass; if non-public interfaces are present,
their class loader is passed instead (if more than one non-public
interface class loader is encountered, an
IllegalAccessError is thrown).
If Proxy.getProxyClass throws an
IllegalArgumentException, resolveProxyClass
will throw a ClassNotFoundException containing the
IllegalArgumentException.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | annotateClass(Class<?>
the class to annotate custom data for c)Overrides java. |
| protected void | annotateProxyClass(Class<?>
the proxy class to annotate custom data for c)
Subclasses may implement this method to store custom data in the stream
along with descriptors for dynamic proxy classes.
|
| queue | back to summary |
|---|---|
| pack-priv Queue<Class<?>> queue | |
| Out | back to summary |
|---|---|
| pack-priv Out(OutputStream out) throws IOException | |
| annotateClass | back to summary |
|---|---|
| protected void annotateClass(Class<?> c) Overrides java. Doc from java. Subclasses may implement this method to allow class data to be stored in the stream. By default this method does nothing. The corresponding method in ObjectInputStream is resolveClass. This method is called exactly once for each unique class in the stream. The class name and signature will have already been written to the stream. This method may make free use of the ObjectOutputStream to save any representation of the class it deems suitable (for example, the bytes of the class file). The resolveClass method in the corresponding subclass of ObjectInputStream must read and use any data or objects written by annotateClass. | |
| annotateProxyClass | back to summary |
|---|---|
| protected void annotateProxyClass(Class<?> c) Overrides java. Doc from java. Subclasses may implement this method to store custom data in the stream along with descriptors for dynamic proxy classes. This method is called exactly once for each unique proxy class
descriptor in the stream. The default implementation of this method in
The corresponding method in | |