|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wisc.cs.java.AttributeInfo
This class represents a genaric attribute in a Java classfile and is the super class of the specific attribute classes.
Field Summary | |
protected byte[] |
attributeData
An array of length num_bytes containing the attribute data. |
protected int |
name_index
An index into the constant pool containing the name of this attribute. |
protected int |
num_bytes
The number of bytes of data for this attribute. |
Constructor Summary | |
protected |
AttributeInfo()
A default constructor for sub-classes. |
|
AttributeInfo(java.io.DataInputStream in)
Constructs a new attribute reading data from the given stream. |
|
AttributeInfo(int n_index,
java.io.DataInputStream in)
Constructs a new attribute reading data from the given stream with the given name index. |
Method Summary | |
int |
getNameIndex()
Returns the constant pool index of the name of this attribute. |
int |
getSize()
Returns the number of bytes necessary to represent this attribute including the six header bytes. |
void |
writeTo(java.io.DataOutputStream out)
Writes an attribute to the specified stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected int name_index
protected int num_bytes
protected byte[] attributeData
Constructor Detail |
protected AttributeInfo()
public AttributeInfo(java.io.DataInputStream in) throws java.io.IOException
in
- the stream from which to read all attribute data.public AttributeInfo(int n_index, java.io.DataInputStream in) throws java.io.IOException
n_index
- the index in the constant pool of the attribute name.in
- the stream from which to read all attribute data.Method Detail |
public int getSize()
public int getNameIndex()
public void writeTo(java.io.DataOutputStream out) throws java.io.IOException
out
- the destination stream to write data to.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |