private void writeCodes(DexFile file, AnnotatedOutput out) {
    DalvInsnList insns = code.getInsns();

    try {
      insns.writeTo(out);
    } catch (RuntimeException ex) {
      throw ExceptionWithContext.withContext(
          ex, "...while writing " + "instructions for " + ref.toHuman());
    }
  }
Helper for {@link #writeTo0} which writes out the actual bytecode.

@param file {@code non-null;} file we are part of
@param out {@code non-null;} where to write to
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/CodeItem.java