public void inputStreamToFile(InputStream is, String filename) throws IOException {
        FileOutputStream fos = new FileOutputStream(filename);
        inputStreamToOutputStream(is, fos);
        fos.close();
    }
public void inputStreamToFile ( InputStream is , String filename ) throws IOException { FileOutputStream fos = new FileOutputStream ( filename ) ; inputStreamToOutputStream ( is , fos ) ; fos . close ( ) ; }
Write to a file the bytes read from an input stream.

@param filename the full or relative path to the file.