Here you can find the source of decompressData(byte[] compressedInput)
public static byte[] decompressData(byte[] compressedInput) throws DataFormatException, IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.zip.DataFormatException; import java.util.zip.Inflater; public class Main { public static byte[] decompressData(byte[] compressedInput) throws DataFormatException, IOException { Inflater decompressor = new Inflater(); decompressor.setInput(compressedInput); ByteArrayOutputStream bos = new ByteArrayOutputStream(compressedInput.length); byte[] buffer = new byte[1024]; // Take chunks of 1024 byte data while (!decompressor.finished()) { int count = decompressor.inflate(buffer); bos.write(buffer, 0, count); }//from www.j av a 2s.c o m bos.close(); return bos.toByteArray(); } }