java.rmi
static class: MarshalledObject.MarshalledObjectOutputStream [javadoc |
source]
java.lang.Object
java.io.OutputStream
java.io.ObjectOutputStream
sun.rmi.server.MarshalOutputStream
java.rmi.MarshalledObject$MarshalledObjectOutputStream
All Implemented Interfaces:
ObjectStreamConstants, ObjectOutput, Flushable, Closeable
This class is used to marshal objects for
MarshalledObject. It places the location annotations
to one side so that two
MarshalledObjects can be
compared for equality if they differ only in location
annotations. Objects written using this stream should be read back
from a
MarshalledObjectInputStream.
| Constructor: |
MarshalledObjectOutputStream(OutputStream objOut,
OutputStream locOut) throws IOException {
super(objOut);
this.useProtocolVersion(ObjectStreamConstants.PROTOCOL_VERSION_2);
this.locOut = new ObjectOutputStream(locOut);
hadAnnotations = false;
}
Creates a new MarshalledObjectOutputStream whose
non-location bytes will be written to objOut and whose
location annotations (if any) will be written to
locOut. |
| Methods from java.io.ObjectOutputStream: |
|---|
|
annotateClass, annotateProxyClass, close, defaultWriteObject, drain, enableReplaceObject, flush, getProtocolVersion, putFields, replaceObject, reset, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeObjectOverride, writeShort, writeStreamHeader, writeTypeString, writeUTF, writeUnshared |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.rmi.MarshalledObject$MarshalledObjectOutputStream Detail: |
public void flush() throws IOException {
super.flush();
locOut.flush();
}
|
boolean hadAnnotations() {
return hadAnnotations;
}
Returns true if any non-null location
annotations have been written to this stream. |
protected void writeLocation(String loc) throws IOException {
hadAnnotations |= (loc != null);
locOut.writeObject(loc);
}
Overrides MarshalOutputStream.writeLocation implementation to write
annotations to the location stream. |