@Override
    public DecodedInstruction decode(int opcodeUnit, CodeInput in) throws EOFException {
      int baseAddress = in.cursor() - 1;
      int opcode = byte0(opcodeUnit);
      int a = byte1(opcodeUnit);
      int target = baseAddress + in.readInt();

      /*
       * Switch instructions need to "forward" their addresses to their
       * payload target instructions.
       */
      switch (opcode) {
        case Opcodes.PACKED_SWITCH:
        case Opcodes.SPARSE_SWITCH:
          {
            in.setBaseAddress(target, baseAddress);
            break;
          }
        default: // fall out
      }

      return new OneRegisterDecodedInstruction(this, opcode, 0, null, target, 0L, a);
    }
Representation of an instruction format, which knows how to decode into and encode from instances
of {@link DecodedInstruction}.
android/android_framework/dex-maker/src/main/java/com/android/dx/io/instructions/InstructionCodec.java