Here you can find the source of unzip(byte[] datas)
private static byte[] unzip(byte[] datas) throws IOException
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.InflaterInputStream; public class Main { private static byte[] unzip(byte[] datas) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayInputStream in = new ByteArrayInputStream(datas); InflaterInputStream iin = new InflaterInputStream(in); byte[] buffer = new byte[256]; int n;/*from w w w . ja v a 2 s . c o m*/ while ((n = iin.read(buffer)) >= 0) { out.write(buffer, 0, n); } return out.toByteArray(); } }