The input stream will be wrapped into a ByteSource, and that will be written as a remote object to the other
endpoint.
The remote ByteSource will be read, and converted back to an InputStream.
Writing the resulting InputStream back to the original endpoint will not return the original InputStream instance to it, but a stream that is forwarded through the remote endpoint. This will probably heavily degrade the performance, so if this scenario is possible to happen, users should choose a different transferring mechanism.
public | Creates a new instance. |
public | Creates a new instance for the given input stream. |
Users shouldn't instantiate this class manually, but leave that to the RMI runtime.
Users shouldn't instantiate this class manually, but leave that to the RMI runtime.
null
.
If RMIWrapper.resolveWrapped() returned this
then this method will be called when the wrapper instance
is serialized to an other endpoint. It is preferred to return a remote proxy to the previously wrapped object to
pass back to the original endpoint when reverse request is made. Returning this
from this method
will result in the serialization of this wrapper through RMI.
If RMIWrapper.resolveWrapped() did not return this
then this method can freely return
null
or throw exceptions (e.g. UnsupportedOperationException) because it will never be
called.
this
.The result of this method will be returned to the caller, or used during the RMI request.
Important aspect of writing objects using wrappers is that in this method if any of the object writing method is called, then the non customizable aspects of the serializable will not be applied to the object that is being wrapped.
E.g. If an RMIWrapper is defined for an object type T, then calling
RMIObjectOutput.writeRemoteObject(