code: public static void copyStream(InputStream copyFrom, File copyTo,
  			GeoPackageProgress progress) throws IOException {
  
  		OutputStream to = new FileOutputStream(copyTo);
  
  		copyStream(copyFrom, to, progress);
  
  		// Try to delete the file if progress was cancelled
  		if (progress != null && !progress.isActive()
  				&& progress.cleanupOnCancel()) {
  			copyTo.delete();
  		}
  	}
docs: Copy an input stream to a file location
  
  @param copyFrom
  from file
  @param copyTo
  to file
  @param progress
  progress tracker
  @throws IOException
  upon failure