Here you can find the source of decompress(byte[] data)
public static byte[] decompress(byte[] data)
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.InflaterOutputStream; public class Main { public static byte[] decompress(byte[] data) { return decompress(data, 0, data.length); }/*from w w w .j a va 2s.c o m*/ public static byte[] decompress(byte[] data, int offset, int length) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(length); InflaterOutputStream inflater = new InflaterOutputStream(out); inflater.write(data, offset, length); inflater.close(); byte[] bytes = out.toByteArray(); out.reset(); InflaterOutputStream inflater2 = new InflaterOutputStream(out); //decompress a second time inflater2.write(bytes); inflater2.close(); return out.toByteArray(); } catch (IOException e) { throw new RuntimeException(e); } } }