Package com.tangosol.io
Class WrapperObjectOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.tangosol.io.WrapperDataOutputStream
-
- com.tangosol.io.WrapperObjectOutputStream
-
- All Implemented Interfaces:
com.oracle.coherence.common.io.OutputStreaming
,OutputStreaming
,Closeable
,DataOutput
,Flushable
,ObjectOutput
,AutoCloseable
- Direct Known Subclasses:
ExternalizableHelper.ShieldedObjectOutputStream
public class WrapperObjectOutputStream extends WrapperDataOutputStream implements ObjectOutput
This is an imitation ObjectOutputStream class that provides the ObjectOutput interface by delegating to an object that implements the ObjectOutput interface. Primarily, this is intended as a base class for building specific-purpose ObjectOutput wrappers.- Author:
- cp 2004.08.20
-
-
Constructor Summary
Constructors Constructor Description WrapperObjectOutputStream(ObjectOutput out)
Construct a WrapperObjectOutputStream that will output to the specified object implementing the ObjectOutput interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBytesWritten()
Return the total number of bytes written to the wrapped DataOutput object.ObjectOutput
getObjectOutput()
Obtain the underlying object providing the ObjectOutput interface that this object is delegating to.void
writeObject(Object o)
Writes the Objecto
so that the correspondingObjectInput.readObject()
method can reconstitute an Object from the written data.-
Methods inherited from class com.tangosol.io.WrapperDataOutputStream
close, flush, getDataOutput, incBytesWritten, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.io.DataOutput
writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
-
-
-
Constructor Detail
-
WrapperObjectOutputStream
public WrapperObjectOutputStream(ObjectOutput out)
Construct a WrapperObjectOutputStream that will output to the specified object implementing the ObjectOutput interface.- Parameters:
out
- an object implementing ObjectOutput to write to
-
-
Method Detail
-
getObjectOutput
public ObjectOutput getObjectOutput()
Obtain the underlying object providing the ObjectOutput interface that this object is delegating to.- Returns:
- the underlying ObjectOutput
-
getBytesWritten
public long getBytesWritten()
Return the total number of bytes written to the wrapped DataOutput object.This method is unsupported.
- Overrides:
getBytesWritten
in classWrapperDataOutputStream
- Returns:
- the total number of bytes written
- Throws:
UnsupportedOperationException
- always
-
writeObject
public void writeObject(Object o) throws IOException
Writes the Objecto
so that the correspondingObjectInput.readObject()
method can reconstitute an Object from the written data.- Specified by:
writeObject
in interfaceObjectOutput
- Parameters:
o
- the Object to write- Throws:
IOException
- if an I/O error occurs
-
-