Class CustomObjectOutputStream
java.lang.Object
java.io.OutputStream
java.io.ObjectOutputStream
com.thoughtworks.xstream.core.util.CustomObjectOutputStream
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,ObjectOutput
,ObjectStreamConstants
,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
static interface
Nested classes/interfaces inherited from class java.io.ObjectOutputStream
ObjectOutputStream.PutField
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionWarning, this object is expensive to create (due to functionality inherited from superclass). -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Methods to delegate to callbackvoid
flush()
static CustomObjectOutputStream
getInstance
(DataHolder whereFrom, CustomObjectOutputStream.StreamCallback callback) void
Allows the CustomObjectOutputStream (which is expensive to create) to be reused.void
reset()
Unsupported methodsvoid
useProtocolVersion
(int version) void
write
(byte[] buf) void
write
(byte[] buf, int off, int len) void
write
(int val) void
writeBoolean
(boolean val) void
writeByte
(int val) void
writeBytes
(String str) void
writeChar
(int val) void
writeChars
(String str) void
writeDouble
(double val) void
void
writeFloat
(float val) void
writeInt
(int val) void
writeLong
(long val) protected void
void
writeShort
(int val) void
writeUnshared
(Object obj) void
Methods inherited from class java.io.ObjectOutputStream
annotateClass, annotateProxyClass, drain, enableReplaceObject, replaceObject, writeClassDescriptor, writeObject, writeStreamHeader
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
callbacks
-
customFields
-
DATA_HOLDER_KEY
-
-
Constructor Details
-
CustomObjectOutputStream
public CustomObjectOutputStream(CustomObjectOutputStream.StreamCallback callback) throws IOException, SecurityException Warning, this object is expensive to create (due to functionality inherited from superclass). Use the static fetch() method instead, wherever possible.- Throws:
IOException
SecurityException
- See Also:
-
-
Method Details
-
getInstance
public static CustomObjectOutputStream getInstance(DataHolder whereFrom, CustomObjectOutputStream.StreamCallback callback) -
pushCallback
Allows the CustomObjectOutputStream (which is expensive to create) to be reused. -
popCallback
-
peekCallback
-
defaultWriteObject
Methods to delegate to callback- Overrides:
defaultWriteObject
in classObjectOutputStream
- Throws:
IOException
-
writeObjectOverride
- Overrides:
writeObjectOverride
in classObjectOutputStream
- Throws:
IOException
-
writeBoolean
- Specified by:
writeBoolean
in interfaceDataOutput
- Overrides:
writeBoolean
in classObjectOutputStream
- Throws:
IOException
-
writeByte
- Specified by:
writeByte
in interfaceDataOutput
- Overrides:
writeByte
in classObjectOutputStream
- Throws:
IOException
-
writeInt
- Specified by:
writeInt
in interfaceDataOutput
- Overrides:
writeInt
in classObjectOutputStream
- Throws:
IOException
-
writeChar
- Specified by:
writeChar
in interfaceDataOutput
- Overrides:
writeChar
in classObjectOutputStream
- Throws:
IOException
-
writeDouble
- Specified by:
writeDouble
in interfaceDataOutput
- Overrides:
writeDouble
in classObjectOutputStream
- Throws:
IOException
-
writeFloat
- Specified by:
writeFloat
in interfaceDataOutput
- Overrides:
writeFloat
in classObjectOutputStream
- Throws:
IOException
-
writeLong
- Specified by:
writeLong
in interfaceDataOutput
- Overrides:
writeLong
in classObjectOutputStream
- Throws:
IOException
-
writeShort
- Specified by:
writeShort
in interfaceDataOutput
- Overrides:
writeShort
in classObjectOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classObjectOutputStream
- Throws:
IOException
-
writeChars
- Specified by:
writeChars
in interfaceDataOutput
- Overrides:
writeChars
in classObjectOutputStream
- Throws:
IOException
-
writeUTF
- Specified by:
writeUTF
in interfaceDataOutput
- Overrides:
writeUTF
in classObjectOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classObjectOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDataOutput
- Specified by:
write
in interfaceObjectOutput
- Overrides:
write
in classObjectOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceObjectOutput
- Overrides:
flush
in classObjectOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceObjectOutput
- Overrides:
close
in classObjectOutputStream
- Throws:
IOException
-
putFields
- Overrides:
putFields
in classObjectOutputStream
-
writeFields
- Overrides:
writeFields
in classObjectOutputStream
- Throws:
IOException
-
reset
public void reset()Unsupported methods- Overrides:
reset
in classObjectOutputStream
-
useProtocolVersion
public void useProtocolVersion(int version) - Overrides:
useProtocolVersion
in classObjectOutputStream
-
writeBytes
- Specified by:
writeBytes
in interfaceDataOutput
- Overrides:
writeBytes
in classObjectOutputStream
-