Class writing, call graph, eclipse project
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
package info.sigterm.deob.attributes;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Attribute
|
||||
public abstract class Attribute
|
||||
{
|
||||
private Attributes attributes;
|
||||
private AttributeType type;
|
||||
private int length;
|
||||
public int nameIndex;
|
||||
|
||||
Attribute(Attributes attr, AttributeType type) throws IOException
|
||||
{
|
||||
@@ -17,6 +20,18 @@ public class Attribute
|
||||
DataInputStream is = attr.getStream();
|
||||
this.length = is.readInt();
|
||||
}
|
||||
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||
writeAttr(new DataOutputStream(bout));
|
||||
|
||||
byte[] b = bout.toByteArray();
|
||||
out.writeInt(b.length);
|
||||
out.write(b);
|
||||
}
|
||||
|
||||
public abstract void writeAttr(DataOutputStream out) throws IOException;
|
||||
|
||||
public Attributes getAttributes()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user