| 1 package com.yworks.yguard.obf.classfile; 2 3 import java.io.DataInput ; 4 import java.io.DataOutput ; 5 6 9 public class VerificationTypeInfo { 10 private int u2_cPoolIndex; 11 private int u2_offset; 12 private int u1_tag; 13 15 17 public static VerificationTypeInfo create(DataInput din) throws java.io.IOException { 18 if (din == null) throw new NullPointerException ("DataInput cannot be null!"); 19 VerificationTypeInfo vti = new VerificationTypeInfo(); 20 vti.read(din); 21 return vti; 22 } 23 24 25 private VerificationTypeInfo() { 27 } 28 29 30 protected void markUtf8Refs(ConstantPool pool) { 31 switch (u1_tag) { 32 case 0: break; 34 case 1: break; 36 case 2: break; 38 case 3: break; 40 case 4: break; 42 case 5: break; 44 case 6: break; 46 case 7: break; 48 case 8: break; 50 default: 51 throw new IllegalArgumentException ("Unkown tag " + u1_tag); 52 } 53 } 54 55 private void read(DataInput din) throws java.io.IOException { 56 u2_cPoolIndex = -1; 57 u1_tag = din.readUnsignedByte(); 58 switch (u1_tag) { 59 case 0: break; 61 case 1: break; 63 case 2: break; 65 case 3: break; 67 case 4: break; 69 case 5: break; 71 case 6: break; 73 case 7: u2_cPoolIndex = din.readUnsignedShort(); 75 break; 76 case 8: u2_offset = din.readUnsignedShort(); 78 break; 79 default: 80 throw new IllegalArgumentException ("Unkown tag " + u1_tag); 81 } 82 } 83 84 85 public void write(DataOutput dout) throws java.io.IOException { 86 dout.writeByte(u1_tag); 87 switch (u1_tag) { 88 case 0: break; 90 case 1: break; 92 case 2: break; 94 case 3: break; 96 case 4: break; 98 case 5: break; 100 case 6: break; 102 case 7: dout.writeShort(u2_cPoolIndex); 104 break; 105 case 8: dout.writeShort(u2_offset); 107 break; 108 default: 109 throw new IllegalArgumentException ("Unkown tag " + u1_tag); 110 } 111 } 112 } 113 | Popular Tags |