public final class EncodedValueReader extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ENCODED_ANNOTATION |
static int |
ENCODED_ARRAY |
static int |
ENCODED_BOOLEAN |
static int |
ENCODED_BYTE |
static int |
ENCODED_CHAR |
static int |
ENCODED_DOUBLE |
static int |
ENCODED_ENUM |
static int |
ENCODED_FIELD |
static int |
ENCODED_FLOAT |
static int |
ENCODED_INT |
static int |
ENCODED_LONG |
static int |
ENCODED_METHOD |
static int |
ENCODED_NULL |
static int |
ENCODED_SHORT |
static int |
ENCODED_STRING |
static int |
ENCODED_TYPE |
protected ByteInput |
in |
Constructor and Description |
---|
EncodedValueReader(ByteInput in) |
EncodedValueReader(ByteInput in,
int knownType)
Creates a new encoded value reader whose only value is the specified
known type.
|
EncodedValueReader(EncodedValue in) |
EncodedValueReader(EncodedValue in,
int knownType) |
Modifier and Type | Method and Description |
---|---|
int |
getAnnotationType()
Returns the type of the annotation just returned by
readAnnotation() . |
int |
peek()
Returns the type of the next value to read.
|
int |
readAnnotation()
Begins reading the fields of an annotation, returning the number of
fields.
|
int |
readAnnotationName() |
int |
readArray()
Begins reading the elements of an array, returning the array's size.
|
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
int |
readEnum() |
int |
readField() |
float |
readFloat() |
int |
readInt() |
long |
readLong() |
int |
readMethod() |
void |
readNull() |
short |
readShort() |
int |
readString() |
int |
readType() |
void |
skipValue()
Skips a single value, including its nested values if it is an array or
annotation.
|
public static final int ENCODED_BYTE
public static final int ENCODED_SHORT
public static final int ENCODED_CHAR
public static final int ENCODED_INT
public static final int ENCODED_LONG
public static final int ENCODED_FLOAT
public static final int ENCODED_DOUBLE
public static final int ENCODED_STRING
public static final int ENCODED_TYPE
public static final int ENCODED_FIELD
public static final int ENCODED_ENUM
public static final int ENCODED_METHOD
public static final int ENCODED_ARRAY
public static final int ENCODED_ANNOTATION
public static final int ENCODED_NULL
public static final int ENCODED_BOOLEAN
protected final ByteInput in
public EncodedValueReader(ByteInput in)
public EncodedValueReader(EncodedValue in)
public EncodedValueReader(ByteInput in, int knownType)
public EncodedValueReader(EncodedValue in, int knownType)
public int peek()
public int readArray()
int arraySize = readArray();
for (int i = 0, i < arraySize; i++) {
readByte();
}
public int readAnnotation()
readAnnotationName()
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();
}
public int getAnnotationType()
readAnnotation()
. This method's value is undefined unless the most
recent call was to readAnnotation()
.public int readAnnotationName()
public byte readByte()
public short readShort()
public char readChar()
public int readInt()
public long readLong()
public float readFloat()
public double readDouble()
public int readString()
public int readType()
public int readField()
public int readEnum()
public int readMethod()
public void readNull()
public boolean readBoolean()
public void skipValue()
Copyright © 2016. All Rights Reserved.