fr.umlv.corosol.component.instruction.impl
Class DefaultJOperandInput

java.lang.Object
  extended by fr.umlv.corosol.component.instruction.impl.DefaultJOperandInput
All Implemented Interfaces:
JOperandInput, JImplementationRepository.Singleton

public class DefaultJOperandInput
extends java.lang.Object
implements JOperandInput, JImplementationRepository.Singleton

Author:
Christophe Deleray

Constructor Summary
DefaultJOperandInput()
           
 
Method Summary
 void fillInput(byte[] byteCode, int offset, int len)
          Reads up length bytes in the specified array from the offset index in order to be parsed by this JOperandInput.
 byte readByte()
          Reads a byte from the byte code stream.
 int readInt()
          Reads an integer from the byte code stream.
 short readShort()
          Reads a short integer from the byte code stream.
 int readUnsignedByte()
          Reads an unsigned byte from the byte code stream.
 int skipNullBytes()
          Skips the padding bytes following the lookupswitch and tableswitch instruction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJOperandInput

public DefaultJOperandInput()
Method Detail

readByte

public byte readByte()
              throws java.io.IOException
Reads a byte from the byte code stream.

Specified by:
readByte in interface JOperandInput
Returns:
a byte read from this stream
Throws:
java.io.IOException - if an I/O error occurs during the reading of the byte code

readUnsignedByte

public int readUnsignedByte()
                     throws java.io.IOException
Reads an unsigned byte from the byte code stream.

Specified by:
readUnsignedByte in interface JOperandInput
Returns:
an unsigned byte byte read from this stream
Throws:
java.io.IOException - if an I/O error occurs during the reading of the byte code

readShort

public short readShort()
                throws java.io.IOException
Reads a short integer from the byte code stream.

Specified by:
readShort in interface JOperandInput
Returns:
a short read from this stream
Throws:
java.io.IOException - if an I/O error occurs during the reading of the byte code

readInt

public int readInt()
            throws java.io.IOException
Reads an integer from the byte code stream.

Specified by:
readInt in interface JOperandInput
Returns:
an integer read from this stream
Throws:
java.io.IOException - if an I/O error occurs during the reading of the byte code

skipNullBytes

public int skipNullBytes()
                  throws java.io.IOException
Skips the padding bytes following the lookupswitch and tableswitch instruction.

Specified by:
skipNullBytes in interface JOperandInput
Returns:
the amount of null bytes skipped
Throws:
java.io.IOException - if an I/O error occurs during the reading of the byte code

fillInput

public void fillInput(byte[] byteCode,
                      int offset,
                      int len)
Description copied from interface: JOperandInput
Reads up length bytes in the specified array from the offset index in order to be parsed by this JOperandInput.

Specified by:
fillInput in interface JOperandInput
Parameters:
byteCode - the buffer which operands are read
offset - the offset from which the operands are read
len - the number of bytes to be read in the bytecode array