code: public void inputStreamToFile(InputStream is, String filename) throws IOException {
          FileOutputStream fos = new FileOutputStream(filename);
          inputStreamToOutputStream(is, fos);
          fos.close();
      }
docs: Write to a file the bytes read from an input stream.
  
  @param filename the full or relative path to the file.