Search in sources :

Example 1 with AttSignature

use of com.android.dx.cf.attrib.AttSignature in project buck by facebook.

the class StdAttributeFactory method signature.

/**
     * Parses a {@code Signature} attribute.
     */
private Attribute signature(DirectClassFile cf, int offset, int length, ParseObserver observer) {
    if (length != 2) {
        throwBadLength(2);
    }
    ByteArray bytes = cf.getBytes();
    ConstantPool pool = cf.getConstantPool();
    int idx = bytes.getUnsignedShort(offset);
    CstString cst = (CstString) pool.get(idx);
    Attribute result = new AttSignature(cst);
    if (observer != null) {
        observer.parsed(bytes, offset, 2, "signature: " + cst);
    }
    return result;
}
Also used : Attribute(com.android.dx.cf.iface.Attribute) AttSignature(com.android.dx.cf.attrib.AttSignature) ConstantPool(com.android.dx.rop.cst.ConstantPool) CstString(com.android.dx.rop.cst.CstString) ByteArray(com.android.dx.util.ByteArray)

Aggregations

AttSignature (com.android.dx.cf.attrib.AttSignature)1 Attribute (com.android.dx.cf.iface.Attribute)1 ConstantPool (com.android.dx.rop.cst.ConstantPool)1 CstString (com.android.dx.rop.cst.CstString)1 ByteArray (com.android.dx.util.ByteArray)1