diff options
author | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-09-04 18:16:16 +0400 |
---|---|---|
committer | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-09-04 18:41:39 +0400 |
commit | 686b5abef9c269a726897c6992d0ea2abea79b04 (patch) | |
tree | d2a03c184d65f5dfa782d13826dbbba41c3a216b /src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java | |
parent | 1cea85e49ae7659e7124383b619730ba6053bb46 (diff) | |
download | fernflower-686b5abef9c269a726897c6992d0ea2abea79b04.tar fernflower-686b5abef9c269a726897c6992d0ea2abea79b04.tar.gz fernflower-686b5abef9c269a726897c6992d0ea2abea79b04.tar.lz fernflower-686b5abef9c269a726897c6992d0ea2abea79b04.tar.xz fernflower-686b5abef9c269a726897c6992d0ea2abea79b04.zip |
java-decompiler: optimization (empty lists allocation avoided)
Diffstat (limited to 'src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java')
-rw-r--r-- | src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java b/src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java index 632575f..5d43100 100644 --- a/src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java +++ b/src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java @@ -16,6 +16,10 @@ package org.jetbrains.java.decompiler.struct.attr; import org.jetbrains.java.decompiler.struct.consts.ConstantPool; +import org.jetbrains.java.decompiler.util.DataInputFullStream; + +import java.io.ByteArrayInputStream; +import java.io.IOException; /* attribute_info { @@ -44,9 +48,8 @@ public class StructGeneralAttribute { public static final String ATTRIBUTE_SYNTHETIC = "Synthetic"; public static final String ATTRIBUTE_DEPRECATED = "Deprecated"; - protected String name; - protected byte[] info; - + private String name; + private byte[] info; public static StructGeneralAttribute createAttribute(String name) { StructGeneralAttribute attr; @@ -100,7 +103,11 @@ public class StructGeneralAttribute { return attr; } - public void initContent(ConstantPool pool) { } + protected DataInputFullStream stream() { + return new DataInputFullStream(new ByteArrayInputStream(info)); + } + + public void initContent(ConstantPool pool) throws IOException { } public void setInfo(byte[] info) { this.info = info; |