private void transformEncodedCatchHandler(Code.CatchHandler catchHandler, IndexMap indexMap) {
    int catchAllAddress = catchHandler.getCatchAllAddress();
    int[] typeIndexes = catchHandler.getTypeIndexes();
    int[] addresses = catchHandler.getAddresses();

    if (catchAllAddress != -1) {
      codeOut.writeSleb128(-typeIndexes.length);
    } else {
      codeOut.writeSleb128(typeIndexes.length);
    }

    for (int i = 0; i < typeIndexes.length; i++) {
      codeOut.writeUleb128(indexMap.adjustType(typeIndexes[i]));
      codeOut.writeUleb128(addresses[i]);
    }

    if (catchAllAddress != -1) {
      codeOut.writeUleb128(catchAllAddress);
    }
  }
Writes the catch handlers to {@code codeOut} and returns their indices.
android/android_framework/dex-maker/src/main/java/com/android/dx/merge/DexMerger.java