用gzip解压缩字节数组
/* 来自 *n o w j a v a . c o m*/ //package com.nowjava; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.zip.GZIPInputStream; public class Main { public static String decompress(byte[] compressed) throws IOException { final int BUFFER_SIZE = 32; ByteArrayInputStream is = new ByteArrayInputStream(compressed); GZIPInputStream gis = new GZIPInputStream(is, BUFFER_SIZE); StringBuilder string = new StringBuilder(); byte[] data = new byte[BUFFER_SIZE]; int bytesRead; while ((bytesRead = gis.read(data)) != -1) { /* from NowJava.com