com.sun.j3d.utils.scenegraph.io.retained
Class StreamControl

java.lang.Object
  extended by com.sun.j3d.utils.scenegraph.io.retained.Controller
      extended by com.sun.j3d.utils.scenegraph.io.retained.StreamControl

public class StreamControl
extends Controller

Provides the infrastructure for ScenGraphStream Reader and Writer


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.j3d.utils.scenegraph.io.retained.Controller
Controller.J3dIOObjectInputStream
 
Field Summary
protected  java.lang.String FILE_IDENT
           
private  java.io.DataInputStream inputStream
           
private  java.io.DataOutputStream outputStream
           
 
Fields inherited from class com.sun.j3d.utils.scenegraph.io.retained.Controller
BG_DIR_PTR, BRANCH_GRAPH_COUNT, classLoader, currentFileVersion, FILE_DESCRIPTION, j3dClasses, NAMES_OBJECTS_TABLE_PTR, NODE_TYPES_PTR, nullObject, outputFileVersion, SYMBOL_TABLE_PTR, symbolTable, UNIVERSE_CONFIG_PTR
 
Constructor Summary
StreamControl(java.io.DataInputStream in)
           
StreamControl(java.io.DataOutputStream out)
           
 
Method Summary
 void addNamedObjects(java.util.HashMap namedObjects)
          Add the named objects to the symbol table
 void close()
           
 long getFilePointer()
          Implementation of abstract method from Controller.
 void loadNodeComponent(SymbolTableData symbol)
          Used by SymbolTable to load a node component that is not in current graph
 BranchGroup readBranchGraph(java.util.HashMap namedObjects)
           
protected  void readBranchGraphs(int[] graphs)
          Read the set of branchgraps.
 void readStreamHeader()
           
 void writeBranchGraph(BranchGroup bg, java.io.Serializable userData)
          The BranchGraph userData is not supported in a stream and will be ignored.
 void writeStreamHeader()
          Prepare the Stream for writing, by sending header information
 
Methods inherited from class com.sun.j3d.utils.scenegraph.io.retained.Controller
addNamedObject, createState, createState, createState, getClassLoader, getCurrentFileVersion, getImageCompression, getNamedObject, getNames, getNodeClassFromID, getNodeClassID, getOutputFileVersion, getSymbolTable, readBounds, readColor3f, readColor4f, readMatrix4d, readNodeComponents, readObject, readPoint3d, readPoint3f, readQuat4f, readSerializedData, readSharedGroup, readTransform3D, readTuple3d, readTuple3f, readTuple4d, readTuple4f, readUniverse, readVector3f, readVector4d, readVector4f, reset, setClassLoader, skipUserData, useSuperClassIfNoChildClass, writeBounds, writeColor3f, writeColor4f, writeMatrix4d, writeNodeComponents, writeObject, writePoint3d, writePoint3f, writeQuat4f, writeSerializedData, writeSharedGroup, writeTransform3D, writeTuple3d, writeTuple3f, writeTuple4d, writeTuple4f, writeUniverse, writeVector3f, writeVector4d, writeVector4f
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_IDENT

protected java.lang.String FILE_IDENT

inputStream

private java.io.DataInputStream inputStream

outputStream

private java.io.DataOutputStream outputStream
Constructor Detail

StreamControl

public StreamControl(java.io.DataOutputStream out)

StreamControl

public StreamControl(java.io.DataInputStream in)
Method Detail

writeStreamHeader

public void writeStreamHeader()
                       throws java.io.IOException
Prepare the Stream for writing, by sending header information

Throws:
java.io.IOException

readStreamHeader

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

addNamedObjects

public void addNamedObjects(java.util.HashMap namedObjects)
Add the named objects to the symbol table


writeBranchGraph

public void writeBranchGraph(BranchGroup bg,
                             java.io.Serializable userData)
                      throws java.io.IOException
The BranchGraph userData is not supported in a stream and will be ignored. However the data in the userData field of the BranchGroup will be stored in the stream

Specified by:
writeBranchGraph in class Controller
Throws:
java.io.IOException

readBranchGraph

public BranchGroup readBranchGraph(java.util.HashMap namedObjects)
                            throws java.io.IOException
Throws:
java.io.IOException

readBranchGraphs

protected void readBranchGraphs(int[] graphs)
                         throws java.io.IOException
Read the set of branchgraps. Used by readUniverse RandomAccessFileControl will read the graphs in the array, StreamControl expects the graphs to follow the universe in the stream so it will read graphs.length branchgraphs.

Specified by:
readBranchGraphs in class Controller
Throws:
java.io.IOException

loadNodeComponent

public void loadNodeComponent(SymbolTableData symbol)
                       throws java.io.IOException
Used by SymbolTable to load a node component that is not in current graph

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in class Controller
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
Implementation of abstract method from Controller. Always returns 0

Specified by:
getFilePointer in class Controller


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.