Java tutorial
//package com.java2s; import java.io.ByteArrayOutputStream; import java.util.zip.Inflater; public class Main { public static byte[] decompressInZlib(byte[] compressData) throws Exception { return decompressInZlib(compressData, 0, compressData.length); } public static byte[] decompressInZlib(byte[] compressData, int offset, int length) throws Exception { Inflater decompresser = new Inflater(); decompresser.setInput(compressData, 0, compressData.length); ByteArrayOutputStream bos = new ByteArrayOutputStream(length); int count; byte[] buf = new byte[1024]; while (!decompresser.finished()) { count = decompresser.inflate(buf); bos.write(buf, 0, count); } byte[] originalData = bos.toByteArray(); decompresser.end(); return originalData; } }