Here you can find the source of getBytes(ZipInputStream zipInputStream)
protected static byte[] getBytes(ZipInputStream zipInputStream) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipInputStream; public class Main { protected static byte[] getBytes(ZipInputStream zipInputStream) throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); InputStream inputStream = new BufferedInputStream(zipInputStream); int b;//from ww w . ja v a 2 s .co m while ((b = inputStream.read()) != -1) { outputStream.write(b); } byte[] byteArray = outputStream.toByteArray(); return byteArray; } }