ojvm.loading
Class ClassFileInputStream

java.lang.Object
  |
  +--ojvm.loading.ClassFileInputStream
Direct Known Subclasses:
ClassInputStream, InstructionInputStream

public abstract class ClassFileInputStream
extends java.lang.Object

Abstract class for finding class files and reading them. We define methods to read the types u1, u2, and u4 used in the specification of the class file format. There are two subclasses. One that specializes in reading the instructions byteArray, and another that reads all other class information.


Field Summary
protected  ClassFileInputStreamE err
           
protected  java.io.DataInputStream stream
           
 
Constructor Summary
protected ClassFileInputStream(byte[] instructionArray, java.lang.String filename)
           
protected ClassFileInputStream(java.lang.String classPath, java.lang.String filename)
           
 
Method Summary
 java.lang.String getFilename()
           
 boolean hasMoreBytes()
           
 byte readByte()
           
 int readInt()
           
 short readShort()
           
 int readU1()
           
 int readU2()
           
 int readU4()
           
 void skipBytes(int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

protected java.io.DataInputStream stream

err

protected ClassFileInputStreamE err
Constructor Detail

ClassFileInputStream

protected ClassFileInputStream(java.lang.String classPath,
                               java.lang.String filename)
                        throws ClassNotFoundE,
                               ClassFileInputStreamE

ClassFileInputStream

protected ClassFileInputStream(byte[] instructionArray,
                               java.lang.String filename)
Method Detail

getFilename

public java.lang.String getFilename()

hasMoreBytes

public boolean hasMoreBytes()
                     throws ClassFileInputStreamE

skipBytes

public void skipBytes(int len)
               throws ClassFileInputStreamE

readU1

public int readU1()
           throws ClassFileInputStreamE

readU2

public int readU2()
           throws ClassFileInputStreamE

readU4

public int readU4()
           throws ClassFileInputStreamE

readByte

public byte readByte()
              throws ClassFileInputStreamE

readShort

public short readShort()
                throws ClassFileInputStreamE

readInt

public int readInt()
            throws ClassFileInputStreamE