Class RawAttribute

java.lang.Object
com.android.dx.cf.attrib.BaseAttribute
com.android.dx.cf.attrib.RawAttribute
All Implemented Interfaces:
Attribute

public final class RawAttribute extends BaseAttribute
Raw attribute, for holding onto attributes that are unrecognized.
  • Constructor Details

    • RawAttribute

      public RawAttribute(String name, ByteArray data, ConstantPool pool)
      Constructs an instance.
      Parameters:
      name - non-null; attribute name
      data - non-null; attribute data
      pool - null-ok; constant pool to use for cpi resolution
    • RawAttribute

      public RawAttribute(String name, ByteArray data, int offset, int length, ConstantPool pool)
      Constructs an instance from a sub-array of a ByteArray.
      Parameters:
      name - non-null; attribute name
      data - non-null; array containing the attribute data
      offset - offset in data to the attribute data
      length - length of the attribute data, in bytes
      pool - null-ok; constant pool to use for cpi resolution
  • Method Details

    • getData

      public ByteArray getData()
      Get the raw data of the attribute.
      Returns:
      non-null; the data
    • byteLength

      public int byteLength()
      Get the total length of the attribute in bytes, including the header. Since the header is always six bytes, the result of this method is always at least 6.
      Returns:
      >= 6; the total length, in bytes
    • getPool

      public ConstantPool getPool()
      Gets the constant pool to use for cpi resolution, if any. It presumably came from the class file that this attribute came from.
      Returns:
      null-ok; the constant pool