driver-legacy/src/main/com/mongodb/gridfs/GridFSDBFile.java
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();
            }
        }
    }
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();
            }
        }
    }
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}