Class PositionAwareObjectOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ObjectOutputStream
-
- org.glassfish.contextpropagation.wireadapters.PositionAwareObjectOutputStream
-
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,ObjectOutput,ObjectStreamConstants,AutoCloseable
public class PositionAwareObjectOutputStream extends ObjectOutputStream
A stream that keeps track of the position
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.io.ObjectOutputStream
ObjectOutputStream.PutField
-
-
Field Summary
-
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, SERIAL_FILTER_PERMISSION, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
-
-
Constructor Summary
Constructors Constructor Description PositionAwareObjectOutputStream(OutputStream os)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddefaultWriteObject()voidflush()shortposition()ObjectOutputStream.PutFieldputFields()voidreset()voiduseProtocolVersion(int version)voidwrite(byte[] buf)voidwrite(byte[] buf, int off, int len)voidwrite(int val)voidwriteBoolean(boolean val)voidwriteByte(int val)voidwriteBytes(String str)voidwriteChar(int val)voidwriteChars(String str)protected voidwriteClassDescriptor(ObjectStreamClass desc)voidwriteDouble(double val)voidwriteFields()voidwriteFloat(float val)voidwriteInt(int val)voidwriteLong(long val)protected voidwriteObjectOverride(Object obj)voidwriteShort(int val)protected voidwriteStreamHeader()voidwriteUnshared(Object obj)voidwriteUTF(String str)-
Methods inherited from class java.io.ObjectOutputStream
annotateClass, annotateProxyClass, drain, enableReplaceObject, replaceObject, writeObject
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
PositionAwareObjectOutputStream
public PositionAwareObjectOutputStream(OutputStream os) throws IOException
- Throws:
IOException
-
-
Method Detail
-
position
public short position() throws IOException- Throws:
IOException
-
writeObjectOverride
protected void writeObjectOverride(Object obj) throws IOException
- Overrides:
writeObjectOverridein classObjectOutputStream- Throws:
IOException
-
writeUnshared
public void writeUnshared(Object obj) throws IOException
- Overrides:
writeUnsharedin classObjectOutputStream- Throws:
IOException
-
writeFields
public void writeFields() throws IOException- Overrides:
writeFieldsin classObjectOutputStream- Throws:
IOException
-
writeStreamHeader
protected void writeStreamHeader() throws IOException- Overrides:
writeStreamHeaderin classObjectOutputStream- Throws:
IOException
-
useProtocolVersion
public void useProtocolVersion(int version) throws IOException- Overrides:
useProtocolVersionin classObjectOutputStream- Throws:
IOException
-
defaultWriteObject
public void defaultWriteObject() throws IOException- Overrides:
defaultWriteObjectin classObjectOutputStream- Throws:
IOException
-
putFields
public ObjectOutputStream.PutField putFields() throws IOException
- Overrides:
putFieldsin classObjectOutputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classObjectOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Overrides:
flushin classObjectOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Overrides:
closein classObjectOutputStream- Throws:
IOException
-
writeClassDescriptor
protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException
- Overrides:
writeClassDescriptorin classObjectOutputStream- Throws:
IOException
-
write
public void write(int val) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
write
public void write(byte[] buf) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
writeBoolean
public void writeBoolean(boolean val) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Overrides:
writeBooleanin classObjectOutputStream- Throws:
IOException
-
writeByte
public void writeByte(int val) throws IOException- Specified by:
writeBytein interfaceDataOutput- Overrides:
writeBytein classObjectOutputStream- Throws:
IOException
-
writeShort
public void writeShort(int val) throws IOException- Specified by:
writeShortin interfaceDataOutput- Overrides:
writeShortin classObjectOutputStream- Throws:
IOException
-
writeChar
public void writeChar(int val) throws IOException- Specified by:
writeCharin interfaceDataOutput- Overrides:
writeCharin classObjectOutputStream- Throws:
IOException
-
writeInt
public void writeInt(int val) throws IOException- Specified by:
writeIntin interfaceDataOutput- Overrides:
writeIntin classObjectOutputStream- Throws:
IOException
-
writeLong
public void writeLong(long val) throws IOException- Specified by:
writeLongin interfaceDataOutput- Overrides:
writeLongin classObjectOutputStream- Throws:
IOException
-
writeFloat
public void writeFloat(float val) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Overrides:
writeFloatin classObjectOutputStream- Throws:
IOException
-
writeDouble
public void writeDouble(double val) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Overrides:
writeDoublein classObjectOutputStream- Throws:
IOException
-
writeBytes
public void writeBytes(String str) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Overrides:
writeBytesin classObjectOutputStream- Throws:
IOException
-
writeChars
public void writeChars(String str) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Overrides:
writeCharsin classObjectOutputStream- Throws:
IOException
-
writeUTF
public void writeUTF(String str) throws IOException
- Specified by:
writeUTFin interfaceDataOutput- Overrides:
writeUTFin classObjectOutputStream- Throws:
IOException
-
-