fr.umlv.corosol.component.instruction
Interface JOperandInput

All Known Implementing Classes:
DefaultJOperandInput, SimpleJOperandInput

public interface JOperandInput

The JOperandInput interface provides for reading operands from a bytecode stream and reconstructing from them data in any Java primitives types.

Author:
Christophe Deleray
See Also:
JInstruction

Method Summary
 void fillInput(byte[] bytecode, int offset, int length)
          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.
 

Method Detail

readByte

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

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

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

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

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

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

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

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

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

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

void fillInput(byte[] bytecode,
               int offset,
               int length)
Reads up length bytes in the specified array from the offset index in order to be parsed by this JOperandInput.

Parameters:
bytecode - the buffer which operands are read
offset - the offset from which the operands are read
length - the number of bytes to be read in the bytecode array