JML

java.io
Class ObjectOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.ObjectOutputStream
All Implemented Interfaces:
DataOutput, ObjectOutput, ObjectStreamConstants

public class ObjectOutputStream
extends OutputStream
implements ObjectOutput, ObjectStreamConstants


Nested Class Summary
private static class ObjectOutputStream.BlockDataOutputStream
           
private static class ObjectOutputStream.HandleTable
           
static class ObjectOutputStream.PutField
           
private  class ObjectOutputStream.PutFieldImpl
           
private static class ObjectOutputStream.ReplaceTable
           
 
Model Field Summary
 
Model fields inherited from class java.io.OutputStream
isOpen, output, outputBytes, wasClosed
 
Model fields inherited from class java.lang.Object
_getClass, objectState, theString
 
Ghost Field Summary
 
Ghost fields inherited from class java.lang.Object
objectTimesFinalized, owner
 
Field Summary
private  ObjectOutputStream.BlockDataOutputStream bout
           
private  ObjectStreamClass curDesc
           
private  Object curObj
           
private  ObjectOutputStream.PutFieldImpl curPut
           
private  int depth
           
private  boolean enableOverride
           
private  boolean enableReplace
           
private  ObjectOutputStream.HandleTable handles
           
private  byte[] primVals
           
private  int protocol
           
private static sun.misc.SoftCache subclassAudits
           
private  ObjectOutputStream.ReplaceTable subs
           
 
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
protected ObjectOutputStream()
           
  ObjectOutputStream(OutputStream)
           
 
Model Method Summary
 
Model methods inherited from class java.lang.Object
hashValue
 
Method Summary
protected  void annotateClass(Class)
           
protected  void annotateProxyClass(Class)
           
private static boolean auditSubclass(Class)
           
private  void clear()
           
 void close()
           
private  void defaultWriteFields(Object, ObjectStreamClass)
           
 void defaultWriteObject()
           
private static void doublesToBytes(double[], int, byte[], int, int)
           
protected  void drain()
           
protected  boolean enableReplaceObject(boolean)
           
private static void floatsToBytes(float[], int, byte[], int, int)
           
 void flush()
           
(package private)  int getProtocolVersion()
           
 ObjectOutputStream.PutField putFields()
           
protected  Object replaceObject(Object)
           
 void reset()
           
 void useProtocolVersion(int)
           
private  void verifySubclass()
           
 void write(byte[])
           
 void write(byte[], int, int)
           
 void write(int)
           
private  void writeArray(Object, ObjectStreamClass, boolean)
           
 void writeBoolean(boolean)
           
 void writeByte(int)
           
 void writeBytes(String)
           
 void writeChar(int)
           
 void writeChars(String)
           
private  void writeClass(Class, boolean)
           
private  void writeClassDesc(ObjectStreamClass, boolean)
           
protected  void writeClassDescriptor(ObjectStreamClass)
           
 void writeDouble(double)
           
private  void writeExternalData(Externalizable)
           
private  void writeFatalException(IOException)
           
 void writeFields()
           
 void writeFloat(float)
           
private  void writeHandle(int)
           
 void writeInt(int)
           
 void writeLong(long)
           
private  void writeNonProxyDesc(ObjectStreamClass, boolean)
           
private  void writeNull()
           
 void writeObject(Object)
           
private  void writeObject0(Object, boolean)
           
protected  void writeObjectOverride(Object)
           
private  void writeOrdinaryObject(Object, ObjectStreamClass, boolean)
           
private  void writeProxyDesc(ObjectStreamClass, boolean)
           
private  void writeSerialData(Object, ObjectStreamClass)
           
 void writeShort(int)
           
protected  void writeStreamHeader()
           
private  void writeString(String, boolean)
           
(package private)  void writeTypeString(String)
           
 void writeUnshared(Object)
           
 void writeUTF(String)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enableOverride

private final boolean enableOverride

subclassAudits

private static final sun.misc.SoftCache subclassAudits

protocol

private int protocol

subs

private final ObjectOutputStream.ReplaceTable subs

enableReplace

private boolean enableReplace

depth

private int depth

handles

private final ObjectOutputStream.HandleTable handles

primVals

private byte[] primVals

bout

private final ObjectOutputStream.BlockDataOutputStream bout

curPut

private ObjectOutputStream.PutFieldImpl curPut

curObj

private Object curObj

curDesc

private ObjectStreamClass curDesc
Constructor Detail

ObjectOutputStream

protected ObjectOutputStream()
                      throws IOException,
                             SecurityException
Throws:
IOException
SecurityException

ObjectOutputStream

public ObjectOutputStream(OutputStream)
                   throws IOException
Throws:
IOException
Method Detail

getProtocolVersion

int getProtocolVersion()

clear

private void clear()

close

public void close()
           throws IOException
Specified by:
close in interface ObjectOutput
Overrides:
close in class OutputStream
Throws:
IOException

defaultWriteObject

public void defaultWriteObject()
                        throws IOException
Throws:
IOException

drain

protected void drain()
              throws IOException
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface ObjectOutput
Overrides:
flush in class OutputStream
Throws:
IOException

reset

public void reset()
           throws IOException
Throws:
IOException

verifySubclass

private void verifySubclass()

writeFields

public void writeFields()
                 throws IOException
Throws:
IOException

writeNull

private void writeNull()
                throws IOException
Throws:
IOException

writeStreamHeader

protected void writeStreamHeader()
                          throws IOException
Throws:
IOException

writeDouble

public void writeDouble(double)
                 throws IOException
Specified by:
writeDouble in interface DataOutput
Throws:
IOException

writeFloat

public void writeFloat(float)
                throws IOException
Specified by:
writeFloat in interface DataOutput
Throws:
IOException

useProtocolVersion

public void useProtocolVersion(int)
                        throws IOException
Throws:
IOException

write

public void write(int)
           throws IOException
Specified by:
write in interface ObjectOutput
Throws:
IOException

writeByte

public void writeByte(int)
               throws IOException
Specified by:
writeByte in interface DataOutput
Throws:
IOException

writeChar

public void writeChar(int)
               throws IOException
Specified by:
writeChar in interface DataOutput
Throws:
IOException

writeHandle

private void writeHandle(int)
                  throws IOException
Throws:
IOException

writeInt

public void writeInt(int)
              throws IOException
Specified by:
writeInt in interface DataOutput
Throws:
IOException

writeShort

public void writeShort(int)
                throws IOException
Specified by:
writeShort in interface DataOutput
Throws:
IOException

writeLong

public void writeLong(long)
               throws IOException
Specified by:
writeLong in interface DataOutput
Throws:
IOException

writeBoolean

public void writeBoolean(boolean)
                  throws IOException
Specified by:
writeBoolean in interface DataOutput
Throws:
IOException

enableReplaceObject

protected boolean enableReplaceObject(boolean)
                               throws SecurityException
Throws:
SecurityException

write

public void write(byte[])
           throws IOException
Specified by:
write in interface ObjectOutput
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[],
                  int,
                  int)
           throws IOException
Specified by:
write in interface ObjectOutput
Overrides:
write in class OutputStream
Throws:
IOException

doublesToBytes

private static void doublesToBytes(double[],
                                   int,
                                   byte[],
                                   int,
                                   int)

floatsToBytes

private static void floatsToBytes(float[],
                                  int,
                                  byte[],
                                  int,
                                  int)

writeExternalData

private void writeExternalData(Externalizable)
                        throws IOException
Throws:
IOException

writeFatalException

private void writeFatalException(IOException)
                          throws IOException
Throws:
IOException

putFields

public ObjectOutputStream.PutField putFields()
                                      throws IOException
Throws:
IOException

writeClassDescriptor

protected void writeClassDescriptor(ObjectStreamClass)
                             throws IOException
Throws:
IOException

writeClassDesc

private void writeClassDesc(ObjectStreamClass,
                            boolean)
                     throws IOException
Throws:
IOException

writeNonProxyDesc

private void writeNonProxyDesc(ObjectStreamClass,
                               boolean)
                        throws IOException
Throws:
IOException

writeProxyDesc

private void writeProxyDesc(ObjectStreamClass,
                            boolean)
                     throws IOException
Throws:
IOException

annotateClass

protected void annotateClass(Class)
                      throws IOException
Throws:
IOException

annotateProxyClass

protected void annotateProxyClass(Class)
                           throws IOException
Throws:
IOException

auditSubclass

private static boolean auditSubclass(Class)

writeClass

private void writeClass(Class,
                        boolean)
                 throws IOException
Throws:
IOException

writeObject

public final void writeObject(Object)
                       throws IOException
Specified by:
writeObject in interface ObjectOutput
Throws:
IOException

writeObjectOverride

protected void writeObjectOverride(Object)
                            throws IOException
Throws:
IOException

writeUnshared

public void writeUnshared(Object)
                   throws IOException
Throws:
IOException

writeObject0

private void writeObject0(Object,
                          boolean)
                   throws IOException
Throws:
IOException

writeBytes

public void writeBytes(String)
                throws IOException
Specified by:
writeBytes in interface DataOutput
Throws:
IOException

writeChars

public void writeChars(String)
                throws IOException
Specified by:
writeChars in interface DataOutput
Throws:
IOException

writeTypeString

void writeTypeString(String)
               throws IOException
Throws:
IOException

writeUTF

public void writeUTF(String)
              throws IOException
Specified by:
writeUTF in interface DataOutput
Throws:
IOException

writeString

private void writeString(String,
                         boolean)
                  throws IOException
Throws:
IOException

defaultWriteFields

private void defaultWriteFields(Object,
                                ObjectStreamClass)
                         throws IOException
Throws:
IOException

writeSerialData

private void writeSerialData(Object,
                             ObjectStreamClass)
                      throws IOException
Throws:
IOException

writeArray

private void writeArray(Object,
                        ObjectStreamClass,
                        boolean)
                 throws IOException
Throws:
IOException

writeOrdinaryObject

private void writeOrdinaryObject(Object,
                                 ObjectStreamClass,
                                 boolean)
                          throws IOException
Throws:
IOException

replaceObject

protected Object replaceObject(Object)
                        throws IOException
Throws:
IOException

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.