public static void writeInputStreamToFile(InputStream stream, File file) throws IOException { if (file == null) throw new IllegalArgumentException("Attempting to write to a null file!"); FileOutputStream out = new FileOutputStream(file); writeInputStreamToOutputStream(stream, out);
public static void writeInputStreamToFile(File f, InputStream is) throws IOException { writeInputStreamToFile(is, f);
    public static void writeInputStreamToFile(InputStream stream, File file) throws IOException {        if (file == null) throw new IllegalArgumentException("Attempting to write to a null file!");        FileOutputStream out = new FileOutputStream(file);        writeInputStreamToOutputStream(stream, out);    }