1 7 package org.gjt.jclasslib.structures.attributes; 8 9 import org.gjt.jclasslib.structures.AttributeInfo; 10 import org.gjt.jclasslib.structures.InvalidByteCodeException; 11 12 import java.io.*; 13 14 20 public class SignatureAttribute extends AttributeInfo { 21 24 public static final String ATTRIBUTE_NAME = "Signature"; 25 26 private static final int LENGTH = 2; 27 28 private int signatureIndex; 29 30 36 public int getSignatureIndex() { 37 return signatureIndex; 38 } 39 40 public void read(DataInput in) 41 throws InvalidByteCodeException, IOException { 42 super.read(in); 43 44 signatureIndex = in.readUnsignedShort(); 45 46 if (debug) debug("read "); 47 } 48 49 public void write(DataOutput out) 50 throws InvalidByteCodeException, IOException { 51 super.write(out); 52 53 out.writeShort(signatureIndex); 54 55 if (debug) debug("wrote "); 56 } 57 58 public int getAttributeLength() { 59 return LENGTH; 60 } 61 62 protected void debug(String message) { 63 super.debug(message + 64 "Signature attribute with signature index " + signatureIndex); 65 } 66 } 67 | Popular Tags |