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/JarWriter.java
if (fileLocation != null) {
				file= new File(fileLocation.toOSString());
				if (file.exists()) {
					lastModified= file.lastModified();
				}
			}
			if (fJarPackage.areDirectoryEntriesIncluded())
				addDirectories(destinationPath, file);
			write(destinationPath, output.toByteArray(), lastModified);
		} catch (IOException ex) {
			
			String message= null;
			if (ex.getLocalizedMessage() != null)
				message= JarPackagerMessages.getFormattedString("JarWriter.writeProblemWithMessage", resource.getFullPath(), ex.getLocalizedMessage()); 
			else
				message= JarPackagerMessages.getFormattedString("JarWriter.writeProblem", resource.getFullPath()); 
			throw JarPackagerUtil.createCoreException(message, ex);
		}					
	}
	
	/**
	 * Creates a new JarEntry with the passed path and contents, and writes it
	 * to the current archive.
	 *
	 * @param	path			the path inside the archive
	 * @param	contents		the bytes to write
	 * @param	lastModified	a long which represents the last modification date
     * @throws	IOException		if an I/O error has occurred
	 */
	protected void write(IPath path, byte[] contents, long lastModified) throws IOException {