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 classstatic interfaceNested classes/interfaces inherited from class ObjectOutputStream
ObjectOutputStream.PutField -
Field Summary
FieldsFields inherited from interface 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 TypeMethodDescriptionvoidclose()voidMethods to delegate to callbackvoidflush()static CustomObjectOutputStreamgetInstance(DataHolder whereFrom, CustomObjectOutputStream.StreamCallback callback) voidAllows the CustomObjectOutputStream (which is expensive to create) to be reused.voidreset()Unsupported methodsvoiduseProtocolVersion(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) voidwriteDouble(double val) voidvoidwriteFloat(float val) voidwriteInt(int val) voidwriteLong(long val) protected voidvoidwriteShort(int val) voidwriteUnshared(Object obj) voidMethods inherited from class ObjectOutputStream
annotateClass, annotateProxyClass, drain, enableReplaceObject, replaceObject, writeClassDescriptor, writeObject, writeStreamHeaderMethods inherited from class 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:
IOExceptionSecurityException- 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:
defaultWriteObjectin classObjectOutputStream- Throws:
IOException
-
writeObjectOverride
- Overrides:
writeObjectOverridein classObjectOutputStream- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceDataOutput- Overrides:
writeBooleanin classObjectOutputStream- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfaceDataOutput- Overrides:
writeBytein classObjectOutputStream- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceDataOutput- Overrides:
writeIntin classObjectOutputStream- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfaceDataOutput- Overrides:
writeCharin classObjectOutputStream- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceDataOutput- Overrides:
writeDoublein classObjectOutputStream- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceDataOutput- Overrides:
writeFloatin classObjectOutputStream- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceDataOutput- Overrides:
writeLongin classObjectOutputStream- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfaceDataOutput- Overrides:
writeShortin classObjectOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput- Overrides:
writeCharsin classObjectOutputStream- Throws:
IOException
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput- Overrides:
writeUTFin classObjectOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Overrides:
writein classObjectOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceObjectOutput- Overrides:
flushin classObjectOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceObjectOutput- Overrides:
closein classObjectOutputStream- Throws:
IOException
-
putFields
- Overrides:
putFieldsin classObjectOutputStream
-
writeFields
- Overrides:
writeFieldsin classObjectOutputStream- Throws:
IOException
-
reset
-
useProtocolVersion
public void useProtocolVersion(int version) - Overrides:
useProtocolVersionin classObjectOutputStream
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput- Overrides:
writeBytesin classObjectOutputStream
-