@Override
    public void encode(DecodedInstruction insn, CodeOutput out) {
      // See above.
      int opcode = insn.getOpcode();
      int shift = (opcode == Opcodes.CONST_HIGH16) ? 16 : 48;
      short literal = (short) (insn.getLiteral() >> shift);

      out.write(codeUnit(opcode, insn.getA()), literal);
    }
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