com.thoughtworks.xstream.core.util
Class CustomObjectOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.ObjectOutputStream
          extended bycom.thoughtworks.xstream.core.util.CustomObjectOutputStream
All Implemented Interfaces:
java.io.DataOutput, java.io.ObjectOutput, java.io.ObjectStreamConstants

public class CustomObjectOutputStream
extends java.io.ObjectOutputStream


Nested Class Summary
static interface CustomObjectOutputStream.StreamCallback
           
 
Nested classes inherited from class java.io.ObjectOutputStream
java.io.ObjectOutputStream.PutField
 
Field Summary
 
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
 
Constructor Summary
CustomObjectOutputStream(CustomObjectOutputStream.StreamCallback callback)
          Warning, this object is expensive to create (due to functionality inherited from superclass).
 
Method Summary
 void close()
           
 void defaultWriteObject()
          Methods to delegate to callback
 void flush()
           
static CustomObjectOutputStream getInstance(DataHolder whereFrom, CustomObjectOutputStream.StreamCallback callback)
           
 CustomObjectOutputStream.StreamCallback peekCallback()
           
 CustomObjectOutputStream.StreamCallback popCallback()
           
 void pushCallback(CustomObjectOutputStream.StreamCallback callback)
          Allows the CustomObjectOutputStream (which is expensive to create) to be reused.
 java.io.ObjectOutputStream.PutField putFields()
           
 void reset()
          Unsupported methods
 void 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(java.lang.String str)
           
 void writeChar(int val)
           
 void writeChars(java.lang.String str)
           
 void writeDouble(double val)
           
 void writeFields()
           
 void writeFloat(float val)
           
 void writeInt(int val)
           
 void writeLong(long val)
           
protected  void writeObjectOverride(java.lang.Object obj)
           
 void writeShort(int val)
           
 void writeUnshared(java.lang.Object obj)
           
 void writeUTF(java.lang.String str)
           
 
Methods inherited from class java.io.ObjectOutputStream
annotateClass, annotateProxyClass, drain, enableReplaceObject, replaceObject, writeClassDescriptor, writeObject, writeStreamHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomObjectOutputStream

public CustomObjectOutputStream(CustomObjectOutputStream.StreamCallback callback)
                         throws java.io.IOException,
                                java.lang.SecurityException
Warning, this object is expensive to create (due to functionality inherited from superclass). Use the static fetch() method instead, wherever possible.

See Also:
getInstance(com.thoughtworks.xstream.converters.DataHolder, com.thoughtworks.xstream.core.util.CustomObjectOutputStream.StreamCallback)
Method Detail

getInstance

public static CustomObjectOutputStream getInstance(DataHolder whereFrom,
                                                   CustomObjectOutputStream.StreamCallback callback)

pushCallback

public void pushCallback(CustomObjectOutputStream.StreamCallback callback)
Allows the CustomObjectOutputStream (which is expensive to create) to be reused.


popCallback

public CustomObjectOutputStream.StreamCallback popCallback()

peekCallback

public CustomObjectOutputStream.StreamCallback peekCallback()

defaultWriteObject

public void defaultWriteObject()
                        throws java.io.IOException
Methods to delegate to callback

Throws:
java.io.IOException

writeObjectOverride

protected void writeObjectOverride(java.lang.Object obj)
                            throws java.io.IOException
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean val)
                  throws java.io.IOException
Throws:
java.io.IOException

writeByte

public void writeByte(int val)
               throws java.io.IOException
Throws:
java.io.IOException

writeInt

public void writeInt(int val)
              throws java.io.IOException
Throws:
java.io.IOException

writeChar

public void writeChar(int val)
               throws java.io.IOException
Throws:
java.io.IOException

writeDouble

public void writeDouble(double val)
                 throws java.io.IOException
Throws:
java.io.IOException

writeFloat

public void writeFloat(float val)
                throws java.io.IOException
Throws:
java.io.IOException

writeLong

public void writeLong(long val)
               throws java.io.IOException
Throws:
java.io.IOException

writeShort

public void writeShort(int val)
                throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] buf)
           throws java.io.IOException
Throws:
java.io.IOException

writeChars

public void writeChars(java.lang.String str)
                throws java.io.IOException
Throws:
java.io.IOException

writeUTF

public void writeUTF(java.lang.String str)
              throws java.io.IOException
Throws:
java.io.IOException

write

public void write(int val)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] buf,
                  int off,
                  int len)
           throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

putFields

public java.io.ObjectOutputStream.PutField putFields()

writeFields

public void writeFields()
                 throws java.io.IOException
Throws:
java.io.IOException

reset

public void reset()
Unsupported methods


useProtocolVersion

public void useProtocolVersion(int version)

writeBytes

public void writeBytes(java.lang.String str)

writeUnshared

public void writeUnshared(java.lang.Object obj)


Copyright © 2004-2007 XStream. All Rights Reserved.