org.ow2.asmdex.lowLevelUtils
Interface IDalvikValueReader

All Known Implementing Classes:
DalvikValueReader, DexFileReader

public interface IDalvikValueReader

Interface to the DalvikValueReader.

Author:
Pierre Crégut

Method Summary
 long completeSignSizedLong(long l, int sz)
          Extends a long read with SizedLong of length sz according to its sign.
 byte[] getContents()
          Returns the byte array included to this reader.
 int getPos()
          Get the current position of the pointer in the stream.
 boolean hasMore()
          Check if there are still data to read in the stream.
 void relativeSeek(int offset)
          Adds an offset to the current position of the pointer in the stream.
 byte sbyte()
          Reads next signed byte value.
 void seek(int pos)
          Set the position of the pointer in the stream.
 int sint()
          Reads next signed integer value.
 long sizedLong(int sz)
          Reads a long of a given size.
 void skipByte()
          Skips a Byte (signed or not).
 void skipInt()
          Skips an Int (signed or not).
 void skipShort()
          Skips a Short (signed or not).
 int sleb128()
          Reads next signed integer value coded in leb128 format
 short sshort()
          Reads next signed short value.
 short ubyte()
          Reads next unsigned byte value.
 int uint()
          Reads next unsigned integer value.
 long uleb128_16()
          Reads next unsigned integer value coded in leb128 format but with 16 bits chars.
 int uleb128_p1()
          Reads next unsigned integer value coded in leb128_p1 format
 int uleb128()
          Reads next unsigned integer value coded in leb128 format
 java.lang.String unicodeString(int strSize)
          Parse a string coded as 16 bit character
 int ushort()
          Reads next unsigned short value.
 java.lang.String utf8String()
          Reads a null terminated UTF8 string as handled by Dalvik (limited to unicode)
 

Method Detail

getContents

byte[] getContents()
Returns the byte array included to this reader.

Returns:
the byte array included to this reader.

sbyte

byte sbyte()
Reads next signed byte value.

Returns:
value read from stream

ubyte

short ubyte()
Reads next unsigned byte value.

Returns:
value read from stream

sshort

short sshort()
Reads next signed short value.

Returns:
value read from stream

ushort

int ushort()
Reads next unsigned short value.

Returns:
value read from stream

sint

int sint()
Reads next signed integer value.

Returns:
value read from stream

uint

int uint()
Reads next unsigned integer value.

Returns:
value read from stream

sleb128

int sleb128()
Reads next signed integer value coded in leb128 format

Returns:
value read from stream

uleb128

int uleb128()
Reads next unsigned integer value coded in leb128 format

Returns:
value read from stream

uleb128_p1

int uleb128_p1()
Reads next unsigned integer value coded in leb128_p1 format

Returns:
value read from stream

uleb128_16

long uleb128_16()
Reads next unsigned integer value coded in leb128 format but with 16 bits chars.

Returns:
value read from stream

sizedLong

long sizedLong(int sz)
Reads a long of a given size. Considered as unsigned.

Parameters:
sz -
Returns:
a positive long

completeSignSizedLong

long completeSignSizedLong(long l,
                           int sz)
Extends a long read with SizedLong of length sz according to its sign.

Parameters:
l -
sz -
Returns:
long value

utf8String

java.lang.String utf8String()
Reads a null terminated UTF8 string as handled by Dalvik (limited to unicode)

Returns:
string

seek

void seek(int pos)
Set the position of the pointer in the stream.

Parameters:
pos - positive absolute position

relativeSeek

void relativeSeek(int offset)
Adds an offset to the current position of the pointer in the stream.

Parameters:
offset - positive or negative offset to add.

getPos

int getPos()
Get the current position of the pointer in the stream. Usually to make a save restore.

Returns:
positive absolute position

unicodeString

java.lang.String unicodeString(int strSize)
Parse a string coded as 16 bit character

Parameters:
strSize -
Returns:
string

hasMore

boolean hasMore()
Check if there are still data to read in the stream.

Returns:
true if more data

skipInt

void skipInt()
Skips an Int (signed or not).


skipShort

void skipShort()
Skips a Short (signed or not).


skipByte

void skipByte()
Skips a Byte (signed or not).