Here you can find the source of decompress(byte[] data)
public static byte[] decompress(byte[] data)
//package com.java2s; //License from project: Apache License import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class Main { public static byte[] decompress(byte[] data) { ByteArrayOutputStream bout = new ByteArrayOutputStream(1024); ZipInputStream zip = new ZipInputStream(new ByteArrayInputStream(data)); try {//from w w w .ja v a 2 s . c om while (true) { ZipEntry zipEntry = zip.getNextEntry(); if (zipEntry == null) break; while (true) { int i = zip.read(); if (i < 0) break; bout.write(i); } break; } zip.close(); } catch (IOException e) { } return bout.toByteArray(); } }