A new MarshalOutputStream is constructed to serialize remote objects or graphs containing remote objects. Objects are written to the stream using the ObjectOutputStream.writeObject method.
MarshalOutputStream maps remote objects to the corresponding remote stub and embeds the location from which to load the stub classes. The location may be ignored by the client but is supplied.
Access | Constructor and Description |
---|---|
public | |
public | MarshalOutputStream(OutputStream out, int protocolVersion)
Creates a marshal output stream with the given protocol version. |
Modifier and Type | Method and Description |
---|---|
protected void | annotateClass(Class<?>
the class to annotate custom data for cl)Overrides java. |
protected void | annotateProxyClass(Class<?>
the proxy class to annotate custom data for cl)
Serializes a location from which to load the specified class.
|
protected final Object | replaceObject(Object
the object to be replaced obj)Overrides java. |
protected void |
MarshalOutputStream | back to summary |
---|---|
public MarshalOutputStream(OutputStream out) throws IOException Creates a marshal output stream with protocol version 1. |
MarshalOutputStream | back to summary |
---|---|
public MarshalOutputStream(OutputStream out, int protocolVersion) throws IOException Creates a marshal output stream with the given protocol version.
|
annotateClass | back to summary |
---|---|
protected void annotateClass(Class<?> cl) throws IOException Overrides java. Serializes a location from which to load the specified class.
|
annotateProxyClass | back to summary |
---|---|
protected void annotateProxyClass(Class<?> cl) throws IOException Overrides java. Serializes a location from which to load the specified class.
|
replaceObject | back to summary |
---|---|
protected final Object replaceObject(Object obj) throws IOException Overrides java. Checks for objects that are instances of java.rmi.Remote that need to be serialized as proxy objects.
|
writeLocation | back to summary |
---|---|
protected void writeLocation(String location) throws IOException Writes the location for the class into the stream. This method can be overridden by subclasses that store this annotation somewhere else than as the next object in the stream, as is done by this class. |