public interface SerializationProvider
This interface provides a mechanism to allow the use of alternate Java Serialization implementations.
The implementation of this interface *must* be thread-safe and must have a no-arg constructor.
| Modifier and Type | Method and Description |
|---|---|
java.io.ObjectInputStream |
createObjectInputStream(java.io.InputStream source)
Creates a new
ObjectInputStream wrapping the specified
source. |
java.io.ObjectOutputStream |
createObjectOutputStream(java.io.OutputStream destination)
Creates a new
ObjectOutputStream wrapping the
specified destination. |
java.io.ObjectInputStream createObjectInputStream(java.io.InputStream source)
throws java.io.IOException
Creates a new ObjectInputStream wrapping the specified
source.
It's extremely important that the ObjectInputStream
returned by this method extends the serialization implementation's ObjectInputStream
and overrides the ObjectInputStream.resolveClass(java.io.ObjectStreamClass)
of to perform the following or the equivalent thereof:
return Class.forName(desc.getName(),true,
Thread.currentThread().getContextClassLoader());
source - the source stream from which to read the Object(s)
fromObjectInputStreamjava.io.IOException - if an error occurs when creating the input streamjava.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream destination)
throws java.io.IOException
Creates a new ObjectOutputStream wrapping the
specified destination.
destination - the destination of the serialized Object(s)ObjectOutputStreamjava.io.IOException - if an error occurs when creating the output streamCopyright ? 2002-2013 Oracle America, Inc. All Rights Reserved.