public void writeTo(DexFile file, AnnotatedOutput out) {
    finishProcessingIfNecessary();

    if (out.annotates()) {
      annotateEntries("  ", null, out);
    }

    int tableSize = table.size();
    for (int i = 0; i < tableSize; i++) {
      CatchTable.Entry one = table.get(i);
      int start = one.getStart();
      int end = one.getEnd();
      int insnCount = end - start;

      if (insnCount >= 65536) {
        throw new UnsupportedOperationException(
            "bogus exception range: " + Hex.u4(start) + ".." + Hex.u4(end));
      }

      out.writeInt(start);
      out.writeShort(insnCount);
      out.writeShort(handlerOffsets.get(one.getHandlers()));
    }

    out.write(encodedHandlers);
  }
Writes this instance to the given stream.

@param file {@code non-null;} file this instance is part of
@param out {@code non-null;} where to write to
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/CatchStructs.java