public void writeTo(File dexOut) throws IOException {
    try (OutputStream out = new FileOutputStream(dexOut)) {
      writeTo(out);
    }
  }
It is the caller's responsibility to close {@code in}.
android/android_framework/dex-maker/src/main/java/com/android/dex/Dex.java