adding zipentry and zipoutputstream classes
updating zipentry
add zipOutputStream and change DeflaterOutputStream
Add tests for creating zip files using both write methods
fixing problems!
zipentry test
Replace Arrays.sort() with an efficient sort algorithm

This change reuses the existing insertion sort (which was previously what
Arrays.sort() executed) in a full intro sort pipeline.

The implementation is based on the Musser paper on intro sort (Musser,
David R. "Introspective sorting and selection algorithms." Softw., Pract.
Exper. 27.8 (1997): 983-993.) and Wikipedia's current description of the
heap sort: http://en.wikipedia.org/wiki/Heapsort.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement Collections#sort

This is really a verbatim translation of Arrays#sort.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement Collections#binarySearch

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement Collections#reverse

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement ArrayList#ensureCapacity

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement the Arrays#copyOf family

... as introduced in Java 6.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement rest of the Arrays#fill family

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement TreeSet#descendingIterator

If need be, this functionality can be sped up by implementing a
descending iterator on the tree without copying it into an ArrayList.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement LinkedHashMap

This implementation is intentionally simple. If and when the need arises,
we can always implement a more performant version.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Implement LinkedHashSet

This implementation is intentionally simple. If and when the need arises,
we can always implement a more performant version.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Teach Finder to find more than just the first matching element

When the system class path contains more than one .jar, it is quite
concievable that, say, 'META-INF/MANIFEST.MF' can be found in multiple
class path elements.

This commit teaches the working horse of class path inspection, the
Finder class, how to continue the search at a given state.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Consider all class path elements in SystemClassLoader#findResources

The findResources method is supposed to enumerate all the class path
elements' matching paths' URLs, but we used to stop at the first one.

While this is good enough when the system class path contains only a
single .jar file, since b88438d2(sketch of JAR support in Finder)
supports more than a single .jar file in the class path.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Teach SystemClassLoader#getResources to not stop at the first match

The getResources method can be used to find all matches in the class
path for a given path, e.g. to seek out all the META-INF/MANIFEST.MF
files contained in all of the .jar files in the class path.

We just taught the findResources() method to return all matches (rather
than only the first), so let's use that method to get all the matches
from the current class loader's class path elements.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a pseudo-integration test for getResources()

This adds an extra class path element to the VM running the unit tests,
writes files with identical file names into both directories and then
verifies that SystemClassLoader#getResources can find them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>