(InputStream input)
| 39 | } |
| 40 | |
| 41 | public static byte[] readStream(InputStream input) throws IOException { |
| 42 | ByteArrayOutputStream result = new ByteArrayOutputStream(); |
| 43 | byte[] buffer = new byte[65536]; |
| 44 | int bytesRead; |
| 45 | while ((bytesRead = input.read(buffer)) != -1) { |
| 46 | result.write(buffer, 0, bytesRead); |
| 47 | } |
| 48 | return result.toByteArray(); |
| 49 | } |
| 50 | |
| 51 | public static byte[] readEntry(InputStream input, String entryName) throws IOException { |
| 52 | ZipInputStream zis = new ZipInputStream(input); |