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
/*
	 * Projects of which files are exported will be built if true
	 * and autobuild is off.
	 */
	private boolean fBuildIfNeeded;
	/*
	 * Leaf elements (no containers) to export
	 */
	private Object[]	fElements; 
	private IPath		fJarLocation; 
	private boolean	fOverwrite;
	private boolean	fCompress;
	
	private boolean	fSaveDescription;
	private IPath		fDescriptionLocation; 
	/*
	 * A normal JAR has a manifest (fUsesManifest is true)
	 * The manifest can be contributed in two ways
	 * - it can be generated (fGenerateManifest is true) and
	 *		- saved (fSaveManifest is true)
	 *		- saved and reused (fReuseManifest is true implies: fSaveManifest is true)
	 * - it can be specified (fGenerateManifest is false and the
	 *		manifest location must be specified (fManifestLocation))
	 */
	private boolean	fUsesManifest;
	private boolean	fSaveManifest;
	private boolean	fReuseManifest;	
	private boolean	fGenerateManifest;
	private IPath		fManifestLocation; 
	/*