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/ui/jarpackager/JarPackageData.java
fCompress= state;
	}
	/**
	 * Tells whether files can be overwritten without warning.
	 * 
	 * @return	<code>true</code> if files can be overwritten without warning
	 */
	public boolean allowOverwrite() {
		return fOverwrite;
	}
	/**
	 * Sets whether files can be overwritten without warning.
	 * 
	 * @param state a boolean indicating the new state
	 */
	public void setOverwrite(boolean state) {
		fOverwrite= state;
	}
	/**
	 * Tells whether class files and resources are exported.
	 * 
	 * @return	<code>true</code> if class files and resources are exported
	 */
	public boolean areClassFilesExported() {
		return fExportClassFiles;
	}
	/**
	 * Sets option to export class files and resources.
	 * 
	 * @param state a boolean indicating the new state