private ByteArrayOutputStream getZipEntryContent(
            ZipInputStream zipStream,
            ZipEntry entry ) throws IOException {
        try (ByteArrayOutputStream content =
                new ByteArrayOutputStream()) {
            byte[] bytes = new byte[(int) entry.getSize()];
            int read;
            while ((read = zipStream.read(bytes, 0, bytes.length)) != -1) {
                content.write(bytes, 0, read);
            }
            return content;
        }
    }
private ByteArrayOutputStream getZipEntryContent ( ZipInputStream zipStream , ZipEntry entry ) throws IOException { try ( ByteArrayOutputStream content = new ByteArrayOutputStream ( ) ) { byte [ ] bytes = new byte [ ( int ) entry . getSize ( ) ] ; int read ; while ( ( read = zipStream . read ( bytes , 0 , bytes . length ) ) != - 1 ) { content . write ( bytes , 0 , read ) ; } return content ; } }
Read the content of the ZipEntry without closing the stream.