1 26 package com.yworks.yguard.obf.classfile; 27 28 import java.io.*; 29 import java.util.*; 30 31 36 public class LocalVariableInfo 37 { 38 40 41 private int u2startpc; 43 private int u2length; 44 private int u2nameIndex; 45 private int u2descriptorIndex; 46 private int u2index; 47 48 49 public static LocalVariableInfo create(DataInput din) throws java.io.IOException 51 { 52 if (din == null) throw new NullPointerException ("DataInput cannot be null!"); 53 LocalVariableInfo lvi = new LocalVariableInfo(); 54 lvi.read(din); 55 return lvi; 56 } 57 58 59 private LocalVariableInfo() {} 61 62 63 protected int getNameIndex() {return u2nameIndex;} 64 65 66 protected void setNameIndex(int index) {u2nameIndex = index;} 67 68 69 protected int getDescriptorIndex() {return u2descriptorIndex;} 70 71 72 protected void setDescriptorIndex(int index) {u2descriptorIndex = index;} 73 74 75 protected void markUtf8Refs(ConstantPool pool) 76 { 77 pool.incRefCount(u2nameIndex); 78 pool.incRefCount(u2descriptorIndex); 79 } 80 81 private void read(DataInput din) throws java.io.IOException 82 { 83 u2startpc = din.readUnsignedShort(); 84 u2length = din.readUnsignedShort(); 85 u2nameIndex = din.readUnsignedShort(); 86 u2descriptorIndex = din.readUnsignedShort(); 87 u2index = din.readUnsignedShort(); 88 } 89 90 91 public void write(DataOutput dout) throws java.io.IOException 92 { 93 dout.writeShort(u2startpc); 94 dout.writeShort(u2length); 95 dout.writeShort(u2nameIndex); 96 dout.writeShort(u2descriptorIndex); 97 dout.writeShort(u2index); 98 } 99 } 100 | Popular Tags |