Package com.android.dex
Class EncodedValueReader
java.lang.Object
com.android.dex.EncodedValueReader
Pull parser for encoded values.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected final ByteInput
-
Constructor Summary
ConstructorDescriptionEncodedValueReader
(EncodedValue in, int knownType) EncodedValueReader
(ByteInput in, int knownType) Creates a new encoded value reader whose only value is the specified known type. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the type of the annotation just returned byreadAnnotation()
.int
peek()
Returns the type of the next value to read.int
Begins reading the fields of an annotation, returning the number of fields.int
int
Begins reading the elements of an array, returning the array's size.boolean
byte
readByte()
char
readChar()
double
int
readEnum()
int
float
int
readInt()
long
readLong()
int
int
int
void
readNull()
short
int
int
readType()
void
Skips a single value, including its nested values if it is an array or annotation.
-
Field Details
-
ENCODED_BYTE
public static final int ENCODED_BYTE- See Also:
-
ENCODED_SHORT
public static final int ENCODED_SHORT- See Also:
-
ENCODED_CHAR
public static final int ENCODED_CHAR- See Also:
-
ENCODED_INT
public static final int ENCODED_INT- See Also:
-
ENCODED_LONG
public static final int ENCODED_LONG- See Also:
-
ENCODED_FLOAT
public static final int ENCODED_FLOAT- See Also:
-
ENCODED_DOUBLE
public static final int ENCODED_DOUBLE- See Also:
-
ENCODED_METHOD_TYPE
public static final int ENCODED_METHOD_TYPE- See Also:
-
ENCODED_METHOD_HANDLE
public static final int ENCODED_METHOD_HANDLE- See Also:
-
ENCODED_STRING
public static final int ENCODED_STRING- See Also:
-
ENCODED_TYPE
public static final int ENCODED_TYPE- See Also:
-
ENCODED_FIELD
public static final int ENCODED_FIELD- See Also:
-
ENCODED_ENUM
public static final int ENCODED_ENUM- See Also:
-
ENCODED_METHOD
public static final int ENCODED_METHOD- See Also:
-
ENCODED_ARRAY
public static final int ENCODED_ARRAY- See Also:
-
ENCODED_ANNOTATION
public static final int ENCODED_ANNOTATION- See Also:
-
ENCODED_NULL
public static final int ENCODED_NULL- See Also:
-
ENCODED_BOOLEAN
public static final int ENCODED_BOOLEAN- See Also:
-
in
-
-
Constructor Details
-
EncodedValueReader
-
EncodedValueReader
-
EncodedValueReader
Creates a new encoded value reader whose only value is the specified known type. This is useful for encoded values without a type prefix, such as class_def_item's encoded_array or annotation_item's encoded_annotation. -
EncodedValueReader
-
-
Method Details
-
peek
public int peek()Returns the type of the next value to read. -
readArray
public int readArray()Begins reading the elements of an array, returning the array's size. The caller must follow up by calling a read method for each element in the array. For example, this reads a byte array:int arraySize = readArray(); for (int i = 0, i < arraySize; i++) { readByte(); }
-
readAnnotation
public int readAnnotation()Begins reading the fields of an annotation, returning the number of fields. The caller must follow up by making alternating calls toreadAnnotationName()
and another read method. For example, this reads an annotation whose fields are all bytes:int fieldCount = readAnnotation(); int annotationType = getAnnotationType(); for (int i = 0; i < fieldCount; i++) { readAnnotationName(); readByte(); }
-
getAnnotationType
public int getAnnotationType()Returns the type of the annotation just returned byreadAnnotation()
. This method's value is undefined unless the most recent call was toreadAnnotation()
. -
readAnnotationName
public int readAnnotationName() -
readByte
public byte readByte() -
readShort
public short readShort() -
readChar
public char readChar() -
readInt
public int readInt() -
readLong
public long readLong() -
readFloat
public float readFloat() -
readDouble
public double readDouble() -
readMethodType
public int readMethodType() -
readMethodHandle
public int readMethodHandle() -
readString
public int readString() -
readType
public int readType() -
readField
public int readField() -
readEnum
public int readEnum() -
readMethod
public int readMethod() -
readNull
public void readNull() -
readBoolean
public boolean readBoolean() -
skipValue
public void skipValue()Skips a single value, including its nested values if it is an array or annotation.
-