Bug 82804 Jar creation should use less memory
I noticed that the JarWriter will read the entire file it plans to store into memory. An optimization would be to stream the file directly into the JarOutputStream. The only catch is with STORED items which need the CRC32 computed. A penalty could be taken in that case to compute the CRC in a loop and then stream the file.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
}
		}
		return (IFile[])unsavedFiles.toArray(new IFile[unsavedFiles.size()]);
	}
	/**
	 * Asks the user to confirm to save the modified resources.
	 * 
	 * @return true if user pressed OK.
	 */
	private boolean confirmSaveModifiedResources(final IFile[] dirtyFiles) {
		if (dirtyFiles == null || dirtyFiles.length == 0)
			return true;
		
		Display display= fParentShell.getDisplay();
		if (display == null || display.isDisposed())
			return false;
		
		final int[] intResult= new int[1];
		Runnable runnable= new Runnable() {
			public void run() {
				ConfirmSaveModifiedResourcesDialog dlg= new ConfirmSaveModifiedResourcesDialog(fParentShell, dirtyFiles);
				intResult[0]= dlg.open();
			}
		};
		display.syncExec(runnable);
		return intResult[0] == IDialogConstants.OK_ID;
	}
	/**
	 * Asks to confirm to save the modified resources
	 * and save them if OK is pressed.