public class GzipUtil {
public static String uncompress(ByteArrayInputStream in,String charset) {
try {
GZIPInputStream gInputStream = new GZIPInputStream(in);
byte[] by = new byte[1024];
StringBuffer strBuffer = new StringBuffer();
int len = 0;
while ((len = gInputStream.read(by)) != -1) {
strBuffer.append( new String(by, 0, len,charset) );
}
return strBuffer.toString();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public classic Test{
private static final byte crlf13 = (byte) 13;
private static final byte crlf10 = (byte) 10;
private static final String HTTP_CONTENT_TYPE = "Content-Type";
private static final String HTTP_CONTENT_ENCODING = "Content-Encoding