Here you can find the source of decompressString(byte[] compressedData)
public static String decompressString(byte[] compressedData)
//package com.java2s; /*// w w w . j av a 2 s .com * @(#) StringUtils.java Jul 20, 2005 * Copyright 2005 Frequency Marketing, Inc. All rights reserved. * Frequency Marketing, Inc. PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.DataFormatException; import java.util.zip.Inflater; public class Main { public static String decompressString(byte[] compressedData) { // Create the decompressor and give it the data to compress Inflater decompressor = new Inflater(); decompressor.setInput(compressedData); // Create an expandable byte array to hold the decompressed data ByteArrayOutputStream bos = new ByteArrayOutputStream(compressedData.length); // Decompress the data byte[] buf = new byte[1024]; while (!decompressor.finished()) { try { int count = decompressor.inflate(buf); bos.write(buf, 0, count); } catch (DataFormatException e) { } } try { bos.close(); } catch (IOException e) { e.printStackTrace(); } // Get the decompressed data byte[] decompressedData = bos.toByteArray(); return new String(decompressedData); } }