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
addError(JarPackagerMessages.getString("JarFileExportOperation.invalidMainClass"), null); 
			return false;
		}
		
		if (fParentShell == null)
			
			return true;
		IFile[] unsavedFiles= getUnsavedFiles();
		if (unsavedFiles.length > 0)
			return saveModifiedResourcesIfUserConfirms(unsavedFiles);
		return true;
	}
	/**
	 * Returns the files which are not saved and which are
	 * part of the files being exported.
	 * 
	 * @return an array of unsaved files
	 */
	private IFile[] getUnsavedFiles() {
		IEditorPart[] dirtyEditors= getDirtyEditors(fParentShell);
		Set unsavedFiles= new HashSet(dirtyEditors.length);
		if (dirtyEditors.length > 0) {
			List selection= JarPackagerUtil.asResources(fJarPackage.getElements());
			for (int i= 0; i < dirtyEditors.length; i++) {
				if (dirtyEditors[i].getEditorInput() instanceof IFileEditorInput) {
					IFile dirtyFile= ((IFileEditorInput)dirtyEditors[i].getEditorInput()).getFile();
					if (JarPackagerUtil.contains(selection, dirtyFile)) {
						unsavedFiles.add(dirtyFile);
					}
				}