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
}
	private IEditorPart[] getDirtyEditors(Shell parent) {
		Display display= parent.getDisplay();
		final Object[] result= new Object[1];
		display.syncExec(
			new Runnable() {
				public void run() {
					result[0]= JavaPlugin.getDirtyEditors();
				}
			}
		);
		return (IEditorPart[])result[0];
	}
	protected void saveDescription() throws CoreException, IOException {
		
		if (fJarPackage.isManifestReused())
			fJarPackage.setGenerateManifest(false);
		ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream();
		IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput);
		ByteArrayInputStream fileInput= null;
		try {
			writer.write(fJarPackage);
			fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray());
			IFile descriptionFile= fJarPackage.getDescriptionFile();
			if (descriptionFile.isAccessible()) {
				if (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString()))
					descriptionFile.setContents(fileInput, true, true, null);
			} else
				descriptionFile.create(fileInput, true, null);
		} finally {