Fix an ICS regression with zip files containing >= 32768 entries.

The usual signed/unsigned 16-bit field problem with zip files. In adding a unit
test I also found two other long-standing bugs:

1. We had O(N^2) behavior when adding files. Someone used an List where they
wanted a Set. Fixed by switching that code over to a Set.

2. We were allowing people to create .zip files with > 64Ki entries but
generating a file that would claim to have (entryCount & 0xffff) entries.
Fixed to throw ZipException until we have proper Zip64 support.

Bug: http://code.google.com/p/android/issues/detail?id=23207
Change-Id: Ice9c9790782639ba50e1ca057bc2cf21a945e147
4 files changed