public boolean readBoolean() { checkType(ENCODED_BOOLEAN); type = MUST_READ; return arg != 0; }
public void readNull() { checkType(ENCODED_NULL); type = MUST_READ; }
public byte readByte() { checkType(ENCODED_BYTE); type = MUST_READ; return (byte) EncodedValueCodec.readSignedInt(in, arg); }
public int readField() { checkType(ENCODED_FIELD); type = MUST_READ; return EncodedValueCodec.readUnsignedInt(in, arg, false); }
public int readInt() { checkType(ENCODED_INT); type = MUST_READ; return EncodedValueCodec.readSignedInt(in, arg); }
public int readString() { checkType(ENCODED_STRING); type = MUST_READ; return EncodedValueCodec.readUnsignedInt(in, arg, false); }
public int readType() { checkType(ENCODED_TYPE); type = MUST_READ; return EncodedValueCodec.readUnsignedInt(in, arg, false); }
public short readShort() { checkType(ENCODED_SHORT); type = MUST_READ; return (short) EncodedValueCodec.readSignedInt(in, arg); }
public char readChar() { checkType(ENCODED_CHAR); type = MUST_READ; return (char) EncodedValueCodec.readUnsignedInt(in, arg, false); }
public double readDouble() { checkType(ENCODED_DOUBLE); type = MUST_READ; return Double.longBitsToDouble(EncodedValueCodec.readUnsignedLong(in, arg, true)); }
public long readLong() { checkType(ENCODED_LONG); type = MUST_READ; return EncodedValueCodec.readSignedLong(in, arg); }
public float readFloat() { checkType(ENCODED_FLOAT); type = MUST_READ; return Float.intBitsToFloat(EncodedValueCodec.readUnsignedInt(in, arg, true)); }
public int readEnum() { checkType(ENCODED_ENUM); type = MUST_READ; return EncodedValueCodec.readUnsignedInt(in, arg, false); }
public int readMethod() { checkType(ENCODED_METHOD); type = MUST_READ; return EncodedValueCodec.readUnsignedInt(in, arg, false); }
/** * 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: <pre> {@code * int arraySize = readArray(); * for (int i = 0, i < arraySize; i++) { * readByte(); * } * }</pre> */ public int readArray() { checkType(ENCODED_ARRAY); type = MUST_READ; return Leb128.readUnsignedLeb128(in); }
/** * Begins reading the fields of an annotation, returning the number of * fields. The caller must follow up by making alternating calls to {@link * #readAnnotationName()} and another read method. For example, this reads * an annotation whose fields are all bytes: <pre> {@code * int fieldCount = readAnnotation(); * int annotationType = getAnnotationType(); * for (int i = 0; i < fieldCount; i++) { * readAnnotationName(); * readByte(); * } * }</pre> */ public int readAnnotation() { checkType(ENCODED_ANNOTATION); type = MUST_READ; annotationType = Leb128.readUnsignedLeb128(in); return Leb128.readUnsignedLeb128(in); }
public int readEnum() { checkType(ENCODED_ENUM); type = MUST_READ; return EncodedValueCodec.readUnsignedInt(in, arg, false); }
public short readShort() { checkType(ENCODED_SHORT); type = MUST_READ; return (short) EncodedValueCodec.readSignedInt(in, arg); }
public int readInt() { checkType(ENCODED_INT); type = MUST_READ; return EncodedValueCodec.readSignedInt(in, arg); }
public int readString() { checkType(ENCODED_STRING); type = MUST_READ; return EncodedValueCodec.readUnsignedInt(in, arg, false); }