com.ibm.aglets
Class AgletOutputStream

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

final class AgletOutputStream
extends java.io.ObjectOutputStream

An instance of this class writes objects and class data into an output stream. This aglet output stream writes objects, class data of these objects and class data of all super classes of these classes. Data written into the output stream must be read by an instance of the AgletInputStream. This aglet output stream writes the name of the class, the URL of its origin , length of class data and class data. If the class is common whose package is "java", "atp" or "aglets", the class data will not be written.

Version:
1.00 96/06/28
Author:
Gaku Yamamoto
See Also:
AgletInputStream

Nested Class Summary
 
Nested classes inherited from class java.io.ObjectOutputStream
java.io.ObjectOutputStream.PutField
 
Field Summary
private  java.util.Vector classes
           
 
Fields inherited from class java.io.ObjectOutputStream
 
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
(package private) AgletOutputStream(java.io.OutputStream out)
          Create a new instance of this class with version given.
 
Method Summary
 void annotateClass(java.lang.Class cls)
          Write the class data into the output stream.
private  java.lang.Class[] getClasses()
           
(package private)  ClassName[] getClassNames(ResourceManager rm)
           
protected  void writeStreamHeader()
           
 
Methods inherited from class java.io.ObjectOutputStream
annotateProxyClass, close, defaultWriteObject, drain, enableReplaceObject, flush, putFields, replaceObject, reset, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeObjectOverride, writeShort, writeUnshared, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classes

private java.util.Vector classes
Constructor Detail

AgletOutputStream

AgletOutputStream(java.io.OutputStream out)
            throws java.io.IOException
Create a new instance of this class with version given.

Parameters:
out - an output stream where data are written into.
Throws:
java.io.IOException - if can not write into the output stream.
Method Detail

annotateClass

public void annotateClass(java.lang.Class cls)
                   throws java.io.IOException
Write the class data into the output stream. Class data of all super classes of the class will be written together.

Throws:
java.io.IOException - if can not write into the output stream.

getClasses

private java.lang.Class[] getClasses()

getClassNames

ClassName[] getClassNames(ResourceManager rm)

writeStreamHeader

protected void writeStreamHeader()
                          throws java.io.IOException
Throws:
java.io.IOException