|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ow2.asmdex.lowLevelUtils.DalvikValueReader
public class DalvikValueReader
Reads the different kinds of primitive Dalvik values from an encapsulated stream.
| Field Summary | |
|---|---|
protected int |
pos
Position in stream |
| Constructor Summary | |
|---|---|
DalvikValueReader(byte[] contents)
Constructor encapsulating an array of bytes. |
|
DalvikValueReader(byte[] dexBytes,
int size_offset)
Constructor encapsulating an input stream. |
|
| Method Summary | |
|---|---|
void |
bytes(byte[] b)
Reads a given number of bytes and fills the given array. |
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. |
static int |
sint(java.io.InputStream stream)
Reads an integer directly from an input stream. |
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) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int pos
| Constructor Detail |
|---|
public DalvikValueReader(byte[] contents)
contents -
public DalvikValueReader(byte[] dexBytes,
int size_offset)
throws java.io.IOException
dexBytes - the bytes containing the resource/dexsize_offset - offset from the begining to find the total file size
java.io.IOException| Method Detail |
|---|
public byte[] getContents()
getContents in interface IDalvikValueReader
public static final int sint(java.io.InputStream stream)
throws java.io.IOException
stream -
java.io.IOExceptionpublic final byte sbyte()
IDalvikValueReader
sbyte in interface IDalvikValueReaderpublic final short ubyte()
IDalvikValueReader
ubyte in interface IDalvikValueReaderpublic final short sshort()
IDalvikValueReader
sshort in interface IDalvikValueReaderpublic final int ushort()
IDalvikValueReader
ushort in interface IDalvikValueReaderpublic final int sint()
IDalvikValueReader
sint in interface IDalvikValueReaderpublic final int uint()
IDalvikValueReader
uint in interface IDalvikValueReaderpublic final int sleb128()
IDalvikValueReader
sleb128 in interface IDalvikValueReaderpublic final int uleb128()
IDalvikValueReader
uleb128 in interface IDalvikValueReaderpublic final int uleb128_p1()
IDalvikValueReader
uleb128_p1 in interface IDalvikValueReaderpublic final long uleb128_16()
IDalvikValueReader
uleb128_16 in interface IDalvikValueReaderpublic final long sizedLong(int sz)
IDalvikValueReader
sizedLong in interface IDalvikValueReader
public final long completeSignSizedLong(long l,
int sz)
completeSignSizedLong in interface IDalvikValueReaderl - sz - size-1 of the encoded number.
public void bytes(byte[] b)
b - the byte array to be filled.public java.lang.String utf8String()
IDalvikValueReader
utf8String in interface IDalvikValueReaderpublic final void seek(int pos)
IDalvikValueReader
seek in interface IDalvikValueReaderpos - positive absolute positionpublic void relativeSeek(int offset)
IDalvikValueReader
relativeSeek in interface IDalvikValueReaderoffset - positive or negative offset to add.public final int getPos()
IDalvikValueReader
getPos in interface IDalvikValueReaderpublic java.lang.String unicodeString(int strSize)
IDalvikValueReader
unicodeString in interface IDalvikValueReaderpublic final boolean hasMore()
IDalvikValueReader
hasMore in interface IDalvikValueReaderpublic final void skipInt()
IDalvikValueReader
skipInt in interface IDalvikValueReaderpublic final void skipShort()
IDalvikValueReader
skipShort in interface IDalvikValueReaderpublic final void skipByte()
IDalvikValueReader
skipByte in interface IDalvikValueReader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||