| 49 | } |
| 50 | |
| 51 | public static byte[] readEntry(InputStream input, String entryName) throws IOException { |
| 52 | ZipInputStream zis = new ZipInputStream(input); |
| 53 | ZipEntry entry; |
| 54 | try { |
| 55 | while ((entry = zis.getNextEntry()) != null) { |
| 56 | if (entry.getName().equals(entryName)) { |
| 57 | byte[] result = readStream(zis); |
| 58 | zis.closeEntry(); |
| 59 | return result; |
| 60 | } |
| 61 | zis.closeEntry(); |
| 62 | } |
| 63 | } finally { |
| 64 | zis.close(); |
| 65 | } |
| 66 | /* entry not found */ |
| 67 | return null; |
| 68 | } |
| 69 | |
| 70 | /** ECMA CRC64 polynomial. */ |
| 71 | private static final long CRC_64_POLY = |