1 29 30 package com.caucho.bytecode; 31 32 import com.caucho.log.Log; 33 34 import java.io.IOException ; 35 import java.util.logging.Logger ; 36 37 40 public class OpaqueAttribute extends Attribute { 41 static private final Logger log = Log.open(OpaqueAttribute.class); 42 43 private byte []_value; 44 45 OpaqueAttribute(String name) 46 { 47 super(name); 48 } 49 50 53 public void setValue(byte []value) 54 { 55 _value = value; 56 } 57 58 61 public byte []getValue() 62 { 63 return _value; 64 } 65 66 69 public void write(ByteCodeWriter out) 70 throws IOException 71 { 72 out.writeUTF8Const(getName()); 73 out.writeInt(_value.length); 74 out.write(_value, 0, _value.length); 75 } 76 77 80 public Attribute export(JavaClass cl, JavaClass target) 81 { 82 target.getConstantPool().addUTF8(getName()); 83 84 OpaqueAttribute attr = new OpaqueAttribute(getName()); 85 86 byte []value = new byte[_value.length]; 87 System.arraycopy(_value, 0, value, 0, _value.length); 88 89 attr.setValue(value); 90 91 return attr; 92 } 93 94 public String toString() 95 { 96 return "OpaqueAttribute[" + getName() + "]"; 97 } 98 } 99 | Popular Tags |