Inline static constant string fields

This commit is contained in:
Adam
2015-08-15 17:05:54 -04:00
parent 8a7e1d1f97
commit 1c8f2dbc27
6 changed files with 218 additions and 3 deletions

View File

@@ -20,6 +20,13 @@ public abstract class Attribute
this.length = is.readInt();
}
Attribute(Attributes attr, AttributeType type, int length)
{
this.attributes = attr;
this.type = type;
this.length = length;
}
public final void write(DataOutputStream out) throws IOException
{
ByteArrayOutputStream bout = new ByteArrayOutputStream();
@@ -28,6 +35,8 @@ public abstract class Attribute
byte[] b = bout.toByteArray();
out.writeInt(b.length);
out.write(b);
length = b.length;
}
public abstract void writeAttr(DataOutputStream out) throws IOException;