Here you can find the source of uncompress(ZipInputStream zipIn)
public static byte[] uncompress(ZipInputStream zipIn) throws IOException
//package com.java2s; //License from project: Apache License import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.ZipInputStream; public class Main { public static byte[] uncompress(ZipInputStream zipIn) throws IOException { if (zipIn.getNextEntry() == null) { return null; }//from w w w .j a v a2 s .c o m final int tmpBufSize = 1024; final byte[] tmpBuf = new byte[tmpBufSize]; byte[] output = null; try (final ByteArrayOutputStream st = new ByteArrayOutputStream();) { int count = 0; while ((count = zipIn.read(tmpBuf, 0, tmpBufSize)) != -1) { st.write(tmpBuf, 0, count); } output = st.toByteArray(); } return output; } }