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
public void setBuildIfNeeded(boolean buildIfNeeded) {
		fBuildIfNeeded= buildIfNeeded;
	}
	
	
	/**
	 * Finds the class files for the given java file 
	 * and returns them.
	 * <p>
	 * This is a hook for subclasses which want to implement
	 * a different strategy for finding the class files. The default
	 * strategy is to query the class files for the source file
	 * name attribute. If this attribute is missing then all class
	 * files in the corresponding output folder are exported.
	 * </p>
	 * <p>
	 * A CoreException can be thrown if an error occurs during this
	 * operation. The <code>CoreException</code> will not stop the export
	 * process but adds the status object to the status of the
	 * export runnable.
	 * </p>
	 * 
	 * @param	javaFile a .java file
	 * @return	an array with class files or <code>null</code> to used the default strategy
	 * @throws	CoreException	if find failed, e.g. I/O error or resource out of sync
	 * @see	IJarExportRunnable#getStatus()
	 */
	public IFile[] findClassfilesFor(IFile javaFile) throws CoreException {
		return null;
	}