Esempio n. 1
0
 /*  70:    */
 /*  71:    */ public static final Instruction readInstruction(ByteSequence bytes)
     /*  72:    */ throws IOException
       /*  73:    */ {
   /*  74:167 */ boolean wide = false;
   /*  75:168 */ short opcode = (short) bytes.readUnsignedByte();
   /*  76:169 */ Instruction obj = null;
   /*  77:171 */ if (opcode == 196)
   /*  78:    */ {
     /*  79:172 */ wide = true;
     /*  80:173 */ opcode = (short) bytes.readUnsignedByte();
     /*  81:    */ }
   /*  82:176 */ if (InstructionConstants.INSTRUCTIONS[opcode] != null) {
     /*  83:177 */ return InstructionConstants.INSTRUCTIONS[opcode];
     /*  84:    */ }
   /*  85:    */ Class clazz;
   /*  86:    */ try
   /*  87:    */ {
     /*  88:184 */ clazz = Class.forName(className(opcode));
     /*  89:    */ }
   /*  90:    */ catch (ClassNotFoundException cnfe)
   /*  91:    */ {
     /*  92:189 */ throw new ClassGenException("Illegal opcode detected.");
     /*  93:    */ }
   /*  94:    */ try
   /*  95:    */ {
     /*  96:192 */ obj = (Instruction) clazz.newInstance();
     /*  97:194 */ if ((wide)
         && (!(obj instanceof LocalVariableInstruction))
         && (!(obj instanceof IINC))
         && (!(obj instanceof RET))) {
       /*  98:196 */ throw new Exception("Illegal opcode after wide: " + opcode);
       /*  99:    */ }
     /* 100:198 */ obj.setOpcode(opcode);
     /* 101:199 */ obj.initFromFile(bytes, wide);
     /* 102:    */ }
   /* 103:    */ catch (Exception e)
   /* 104:    */ {
     /* 105:201 */ throw new ClassGenException(e.toString());
     /* 106:    */ }
   /* 107:203 */ return obj;
   /* 108:    */ }
Esempio n. 2
0
 /** Read needed data (i.e., no. dimension) from file. */
 protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException {
   super.initFromFile(bytes, wide);
   dimensions = bytes.readByte();
   length = 4;
 }