com.android.dx.cf.attrib
Class RawAttribute

java.lang.Object
  extended by com.android.dx.cf.attrib.BaseAttribute
      extended by 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 Summary
RawAttribute(String name, ByteArray data, ConstantPool pool)
          Constructs an instance.
RawAttribute(String name, ByteArray data, int offset, int length, ConstantPool pool)
          Constructs an instance from a sub-array of a ByteArray.
 
Method Summary
 int byteLength()
          Get the total length of the attribute in bytes, including the header.
 ByteArray getData()
          Get the raw data of the attribute.
 ConstantPool getPool()
          Gets the constant pool to use for cpi resolution, if any.
 
Methods inherited from class com.android.dx.cf.attrib.BaseAttribute
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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


Copyright © 2015. All rights reserved.