code: public long writeTo(final File file) throws IOException {
          FileOutputStream out = null;
          try {
              out = new FileOutputStream(file);
              return writeTo(out);
          } finally {
              if (out != null) {
                  out.close();
              }
          }
      }
docs: Writes the file's data to a file on disk.
  
  @param file the File object
  @return number of bytes written
  @throws IOException if there are problems writing to the {@code file}