nz.net.juju.jaune
Class CodeInput

java.lang.Object
  |
  +--nz.net.juju.jaune.CodeInput

public class CodeInput
extends java.lang.Object

Provides a simple wrapper around the actual code bytes of a method including access methods for words and dwords, and a way of tracking the value of the program counter.


Constructor Summary
CodeInput(java.io.InputStream in)
           
 
Method Summary
 int getPC()
          Returns the current offset in the code.
 int readByte()
          Returns an unsigned 8 bit value
 int readSignedByte()
          Returns a signed 8 bit value
 int readSignedDWord()
          Returns a signed 32 bit value
 int readSignedWord()
          Returns a signed 16 bit value
 void readToBoundary(int mod)
          Reads from the input until the PC is at a multiple of mod.
 int readWord()
          Returns a unsigned 16 bit value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeInput

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

getPC

public int getPC()
Returns the current offset in the code. Is updated by every read* method.

readWord

public int readWord()
             throws java.io.IOException
Returns a unsigned 16 bit value

readSignedWord

public int readSignedWord()
                   throws java.io.IOException
Returns a signed 16 bit value

readSignedDWord

public int readSignedDWord()
                    throws java.io.IOException
Returns a signed 32 bit value

readByte

public int readByte()
             throws java.io.IOException
Returns an unsigned 8 bit value

readSignedByte

public int readSignedByte()
                   throws java.io.IOException
Returns a signed 8 bit value

readToBoundary

public void readToBoundary(int mod)
                    throws java.io.IOException
Reads from the input until the PC is at a multiple of mod.