62,635
社区成员




// 建立grip压缩文件输入流
InputStream fin = new ByteArrayInputStream(contentbyte);
/**
* 测试时候进入gzip解码
*/
System.out.println("\n\n\n\nGZIP!\n\n\n\n");
try {
// 建立gzip解压工作流
GZIPInputStream gzin = new GZIPInputStream(fin);
byte[] buf = new byte[1024];
ArrayList<byte[]> cb = new ArrayList<byte[]>();
int num, len = 0;
while ((num = gzin.read(buf, 0, buf.length)) != -1) {
byte[] cell = new byte[num];
len += num;
System.arraycopy(buf, 0, cell, 0, num);
cb.add(cell);
}
contentbyte = new byte[len];
num = 0;
for (byte[] c : cb) {
System.arraycopy(c, 0, contentbyte, num, c.length);
num += c.length;
}
gzin.close();
fin.close();