public static interface ClassFileWriter.AttributeWriter
For example, the following object writes a synthetic attribute:
ConstPoolWriter cpw = ...;
final int tag = cpw.addUtf8Info("Synthetic");
AttributeWriter aw = new AttributeWriter() {
public int size() {
return 1;
}
public void write(DataOutputStream out) throws java.io.IOException {
out.writeShort(tag);
out.writeInt(0);
}
};
| Modifier and Type | Method and Description |
|---|---|
int |
size()
Returns the number of attributes that this writer will
write.
|
void |
write(DataOutputStream out)
Writes all the contents of the attributes.
|
int size()
void write(DataOutputStream out) throws IOException
attribute_info.IOExceptionCopyright © 2016 Shigeru Chiba, www.javassist.org. All Rights Reserved.