com.sun.j3d.loaders.lw3d
Class LWOBFileReader

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.BufferedInputStream
              extended by com.sun.j3d.loaders.lw3d.LWOBFileReader
All Implemented Interfaces:
java.io.Closeable

 class LWOBFileReader
extends java.io.BufferedInputStream


Field Summary
protected  DebugOutput debugPrinter
           
(package private) static int EXCEPTION
           
(package private) static int LINE_TRACE
           
protected  int marker
           
(package private) static int MISC
           
(package private) static int NONE
           
protected  java.lang.String theFilename
           
(package private) static int TRACE
           
(package private) static int VALUES
           
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
LWOBFileReader(java.lang.String filename)
          Constructor.
LWOBFileReader(java.net.URL url)
           
 
Method Summary
protected  void debugOutputLn(int outputType, java.lang.String theOutput)
           
 java.lang.String getFilename()
          Returns the name of the file associated with this stream
 float getFloat()
          Read four bytes from the file and return their float value
 int getInt()
          Read four bytes from the file and return their integer value
 int getMarker()
          Returns the current position in the file
 int getShortInt()
          Reads two bytes from the file and returns their integer value.
 java.lang.String getString()
          Returns a string read from the file.
 java.lang.String getToken()
           
 void getVerts(float[] ar, int num)
          Reads an array of xyz values.
 int read()
           
 int read(byte[] buffer, int offset, int count)
           
 void skipLength(int amount)
          Skip ahead amount bytes in the file
 
Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

static final int TRACE
See Also:
Constant Field Values

VALUES

static final int VALUES
See Also:
Constant Field Values

MISC

static final int MISC
See Also:
Constant Field Values

LINE_TRACE

static final int LINE_TRACE
See Also:
Constant Field Values

NONE

static final int NONE
See Also:
Constant Field Values

EXCEPTION

static final int EXCEPTION
See Also:
Constant Field Values

debugPrinter

protected DebugOutput debugPrinter

theFilename

protected java.lang.String theFilename

marker

protected int marker
Constructor Detail

LWOBFileReader

public LWOBFileReader(java.lang.String filename)
               throws java.io.FileNotFoundException
Constructor.

Throws:
java.io.FileNotFoundException

LWOBFileReader

public LWOBFileReader(java.net.URL url)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

debugOutputLn

protected void debugOutputLn(int outputType,
                             java.lang.String theOutput)

getToken

public java.lang.String getToken()
                          throws ParsingErrorException
Throws:
ParsingErrorException

skipLength

public void skipLength(int amount)
                throws ParsingErrorException
Skip ahead amount bytes in the file

Throws:
ParsingErrorException

getInt

public int getInt()
           throws ParsingErrorException
Read four bytes from the file and return their integer value

Throws:
ParsingErrorException

getFloat

public float getFloat()
               throws ParsingErrorException
Read four bytes from the file and return their float value

Throws:
ParsingErrorException

getFilename

public java.lang.String getFilename()
Returns the name of the file associated with this stream


getString

public java.lang.String getString()
                           throws ParsingErrorException
Returns a string read from the file. The string is assumed to end with '0'.

Throws:
ParsingErrorException

getVerts

public void getVerts(float[] ar,
                     int num)
              throws ParsingErrorException
Reads an array of xyz values.

Throws:
ParsingErrorException

getShortInt

public int getShortInt()
                throws ParsingErrorException
Reads two bytes from the file and returns their integer value.

Throws:
ParsingErrorException

getMarker

public int getMarker()
Returns the current position in the file


read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.BufferedInputStream
Throws:
java.io.IOException

read

public int read(byte[] buffer,
                int offset,
                int count)
         throws java.io.IOException
Overrides:
read in class java.io.BufferedInputStream
Throws:
java.io.IOException


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