org.xith3d.io
Class ScribeInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by org.xith3d.io.ScribeInputStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput

public class ScribeInputStream
extends java.io.DataInputStream

Stream for reading cosm objects. :Id: ScribeInputStream.java,v 1.10 2003/02/24 00:13:44 wurp Exp $ :Log: ScribeInputStream.java,v $ Revision 1.10 2003/02/24 00:13:44 wurp Formatted all java code for cvs (strictSunConvention.xml) Revision 1.9 2002/09/11 00:53:53 dilvish Big commit of new changes Revision 1.8 2002/01/23 04:38:33 wurp Integrating i18n code Revision 1.7 2002/01/20 05:26:02 dilvish JDK 1.4 port Revision 1.6 2002/01/15 03:36:55 dilvish Improvements to the animation system Revision 1.5 2002/01/12 03:16:27 dilvish Added read/write of buffered images Revision 1.4 2001/11/17 03:13:02 dilvish Added the ability to read/write arrays of vectors Revision 1.3 2001/07/14 14:48:10 wurp New animation, sky and avatar movement Revision 1.2 2001/06/20 04:05:41 wurp added log4j. Revision 1.1 2001/06/06 22:42:37 wizofid Massive commit / reintegration


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
ScribeInputStream(java.io.InputStream in)
           
 
Method Summary
 byte[] readByteArray()
          Allocates a byte array and loads it from the stream
 int readByteArray(byte[] data)
          Reads in an array of byte and return the number of bytes read.
 org.openmali.vecmath2.Colorf readColor3f()
           
 void readColor3f(org.openmali.vecmath2.Colorf v)
           
 org.jagatoo.image.DirectBufferedImage readDirectImage()
           
 float[] readFloatArray()
          Allocates a float array and loads it from the stream
 int readFloatArray(float[] data)
          Reads in an array of float and return the number of floats read.
 java.awt.image.BufferedImage readImage()
           
 int[] readIntArray()
          Allocates a float array and loads it from the stream
 int readIntArray(int[] data)
          Reads in an array of float and return the number of floats read.
 java.awt.image.BufferedImage readLossyImage()
          Reads in the image which has been stored in a lossy compression format
 void readMatrix(org.openmali.vecmath2.Matrix3f v)
           
 void readMatrix(org.openmali.vecmath2.Matrix4f v)
           
 org.openmali.vecmath2.Matrix3f readMatrix3f()
           
 org.openmali.vecmath2.Matrix4f readMatrix4f()
           
 void readPoint(org.openmali.vecmath2.Point3f p)
           
 void readQuat(org.openmali.vecmath2.Quaternion4f v)
           
 org.openmali.vecmath2.Quaternion4f readQuat4f()
           
 Scribable readScribable()
          reads in a scribable node by getting the class name from the stream, building the object and calling its scribable method to load it.
 short[] readShortArray()
           
 int readShortArray(short[] data)
          Reads in an array of float and return the number of floats read.
 org.openmali.vecmath2.TexCoord2f readTexCoord()
           
 void readTexCoord(org.openmali.vecmath2.TexCoord2f v)
           
 org.openmali.vecmath2.Vector3f readVector()
           
 void readVector(org.openmali.vecmath2.Vector3f v)
           
 org.openmali.vecmath2.Vector3f[] readVectorArray()
          Allocates a float array and loads it from the stream
 int readVectorArray(org.openmali.vecmath2.Vector3f[] data)
          Reads in an array of vectors and return the number of vectors read.
 void setReadHeaderOnly(boolean header)
          Setting this to true will allow objects being loaded to only load their header information.
 boolean shouldReadHeaderOnly()
           
 
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScribeInputStream

public ScribeInputStream(java.io.InputStream in)
Method Detail

setReadHeaderOnly

public void setReadHeaderOnly(boolean header)
Setting this to true will allow objects being loaded to only load their header information.

Parameters:
header -

shouldReadHeaderOnly

public boolean shouldReadHeaderOnly()

readScribable

public Scribable readScribable()
                        throws java.io.IOException,
                               InvalidFormat
reads in a scribable node by getting the class name from the stream, building the object and calling its scribable method to load it.

Throws:
java.io.IOException
InvalidFormat

readFloatArray

public int readFloatArray(float[] data)
                   throws java.io.IOException
Reads in an array of float and return the number of floats read. The data array must be big enough to read in all the floats in the array

Throws:
java.io.IOException

readFloatArray

public float[] readFloatArray()
                       throws java.io.IOException
Allocates a float array and loads it from the stream

Throws:
java.io.IOException

readByteArray

public int readByteArray(byte[] data)
                  throws java.io.IOException
Reads in an array of byte and return the number of bytes read. The data array must be big enough to read in all the bytes in the array

Throws:
java.io.IOException

readByteArray

public byte[] readByteArray()
                     throws java.io.IOException
Allocates a byte array and loads it from the stream

Throws:
java.io.IOException

readVectorArray

public int readVectorArray(org.openmali.vecmath2.Vector3f[] data)
                    throws java.io.IOException
Reads in an array of vectors and return the number of vectors read. The data array must be big enough to read in all the vectors in the array

Throws:
java.io.IOException

readVectorArray

public org.openmali.vecmath2.Vector3f[] readVectorArray()
                                                 throws java.io.IOException
Allocates a float array and loads it from the stream

Throws:
java.io.IOException

readIntArray

public int readIntArray(int[] data)
                 throws java.io.IOException
Reads in an array of float and return the number of floats read. The data array must be big enough to read in all the floats in the array

Throws:
java.io.IOException

readShortArray

public int readShortArray(short[] data)
                   throws java.io.IOException
Reads in an array of float and return the number of floats read. The data array must be big enough to read in all the floats in the array

Throws:
java.io.IOException

readIntArray

public int[] readIntArray()
                   throws java.io.IOException
Allocates a float array and loads it from the stream

Throws:
java.io.IOException

readShortArray

public short[] readShortArray()
                       throws java.io.IOException
Throws:
java.io.IOException

readPoint

public void readPoint(org.openmali.vecmath2.Point3f p)
               throws java.io.IOException
Throws:
java.io.IOException

readVector

public void readVector(org.openmali.vecmath2.Vector3f v)
                throws java.io.IOException
Throws:
java.io.IOException

readVector

public org.openmali.vecmath2.Vector3f readVector()
                                          throws java.io.IOException
Throws:
java.io.IOException

readColor3f

public void readColor3f(org.openmali.vecmath2.Colorf v)
                 throws java.io.IOException
Throws:
java.io.IOException

readColor3f

public org.openmali.vecmath2.Colorf readColor3f()
                                         throws java.io.IOException
Throws:
java.io.IOException

readQuat

public void readQuat(org.openmali.vecmath2.Quaternion4f v)
              throws java.io.IOException
Throws:
java.io.IOException

readQuat4f

public org.openmali.vecmath2.Quaternion4f readQuat4f()
                                              throws java.io.IOException
Throws:
java.io.IOException

readMatrix

public void readMatrix(org.openmali.vecmath2.Matrix3f v)
                throws java.io.IOException
Throws:
java.io.IOException

readMatrix

public void readMatrix(org.openmali.vecmath2.Matrix4f v)
                throws java.io.IOException
Throws:
java.io.IOException

readMatrix3f

public org.openmali.vecmath2.Matrix3f readMatrix3f()
                                            throws java.io.IOException
Throws:
java.io.IOException

readMatrix4f

public org.openmali.vecmath2.Matrix4f readMatrix4f()
                                            throws java.io.IOException
Throws:
java.io.IOException

readTexCoord

public void readTexCoord(org.openmali.vecmath2.TexCoord2f v)
                  throws java.io.IOException
Throws:
java.io.IOException

readTexCoord

public org.openmali.vecmath2.TexCoord2f readTexCoord()
                                              throws java.io.IOException
Throws:
java.io.IOException

readImage

public java.awt.image.BufferedImage readImage()
                                       throws java.io.IOException
Throws:
java.io.IOException

readDirectImage

public org.jagatoo.image.DirectBufferedImage readDirectImage()
                                                      throws java.io.IOException
Throws:
java.io.IOException

readLossyImage

public java.awt.image.BufferedImage readLossyImage()
                                            throws java.io.IOException
Reads in the image which has been stored in a lossy compression format

Returns:
BufferedImage
Throws:
java.io.IOException