ojvm.loading.instructions
Class InstructionInputStream

java.lang.Object
  |
  +--ojvm.loading.ClassFileInputStream
        |
        +--ojvm.loading.instructions.InstructionInputStream

public class InstructionInputStream
extends ClassFileInputStream

A specialized input stream for reading byte arrays of instructions. Compared to ClassInputStream, the new functionality is to keep track of how many bytes were read so far so that we can conveniently deal with instructions that must be aligned on a 4-byte boundary.


Fields inherited from class ojvm.loading.ClassFileInputStream
err, stream
 
Constructor Summary
InstructionInputStream(byte[] instructionArray, java.lang.String filename)
           
 
Method Summary
 int getByteArrayLength()
           
 byte readByte()
           
 int readInt()
           
 short readShort()
           
 int readU1()
           
 int readU2()
           
 int readU4()
           
 void skipBytes(int len)
           
 
Methods inherited from class ojvm.loading.ClassFileInputStream
getFilename, hasMoreBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstructionInputStream

public InstructionInputStream(byte[] instructionArray,
                              java.lang.String filename)
Method Detail

getByteArrayLength

public int getByteArrayLength()

skipBytes

public void skipBytes(int len)
               throws ClassFileInputStreamE
Overrides:
skipBytes in class ClassFileInputStream

readU1

public int readU1()
           throws ClassFileInputStreamE
Overrides:
readU1 in class ClassFileInputStream

readU2

public int readU2()
           throws ClassFileInputStreamE
Overrides:
readU2 in class ClassFileInputStream

readU4

public int readU4()
           throws ClassFileInputStreamE
Overrides:
readU4 in class ClassFileInputStream

readByte

public byte readByte()
              throws ClassFileInputStreamE
Overrides:
readByte in class ClassFileInputStream

readShort

public short readShort()
                throws ClassFileInputStreamE
Overrides:
readShort in class ClassFileInputStream

readInt

public int readInt()
            throws ClassFileInputStreamE
Overrides:
readInt in class ClassFileInputStream