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
fManifestMainClass= manifestMainClass;
	}
	/**
	 * Returns the elements which will be exported.
	 * These elements are leaf objects e.g. <code>IFile</code>
	 * and not containers.
	 * 
	 * @return an array of leaf objects
	 */
	public Object[] getElements() {
		if (fElements == null)
			setElements(new Object[0]);
		return fElements;
	}
	/**
	 * Set the elements which will be exported.
	 * 
	 * These elements are leaf objects e.g. <code>IFile</code>.
	 * and not containers.
	 * 
	 * @param elements	an array with leaf objects
	 */
	public void setElements(Object[] elements) {
		fElements= elements;
	}
	/**
	 * Returns the JAR's comment.
	 * 
	 * @return the comment string or <code>null</code>
	 * 			if the JAR does not contain a comment