📄 attribute.java
字号:
// Attribute.java -- Attribute handlingpackage toba.classfile;import java.io.*;public classAttribute { // field, method, or class attribute String name; byte[] data;public StringtoString (){ return name + "[" + data.length + "bytes]";}// new Attribute(stream, ctab) -- load attribute from class fileAttribute(DataInputStream d, Constant c[]) throws IOException{ name = (String)c[d.readUnsignedShort()].value; d.readFully(data = new byte[d.readInt()]);}// find(a, s) -- find an attribute in an arraypublic static byte[] find(Attribute a[], String s){ for (int i = 0; i < a.length; i++) if (a[i].name.equals(s)) return a[i].data; return null;}} // class Attribute
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -