处理被Gzip的压缩过的数据
来源:互联网 发布:淘宝开店 虚拟商品 编辑:程序博客网 时间:2024/04/26 23:59
String contentEncoding = con.getContentEncoding();
InputStream in = con.getInputStream();
if ("gzip".equalsIgnoreCase(contentEncoding))
in = new GZIPInputStream(in);
else "deflate".equalsIgnoreCase(contentEncoding);
StringBuilder sb = new StringBuilder("");
BufferedReader reader = new BufferedReader(new InputStreamReader(in, BSUtil.isNullOrEmpty(request.getResponseEncoding()) ? "UTF-8" : request.getResponseEncoding()));
String line = "";
while ((line = reader.readLine()) != null) {
sb.append(line).append("\r\n");
}
reader.close();
con.disconnect();
response.setPage(sb.toString());
response.setCode(con.getResponseCode());
InputStream in = con.getInputStream();
if ("gzip".equalsIgnoreCase(contentEncoding))
in = new GZIPInputStream(in);
else "deflate".equalsIgnoreCase(contentEncoding);
StringBuilder sb = new StringBuilder("");
BufferedReader reader = new BufferedReader(new InputStreamReader(in, BSUtil.isNullOrEmpty(request.getResponseEncoding()) ? "UTF-8" : request.getResponseEncoding()));
String line = "";
while ((line = reader.readLine()) != null) {
sb.append(line).append("\r\n");
}
reader.close();
con.disconnect();
response.setPage(sb.toString());
response.setCode(con.getResponseCode());
- 处理被Gzip的压缩过的数据
- 乱码被GZip压缩过的Response进行解压
- Nginx gzip对json数据的压缩
- php 获取gzip压缩过了的源码
- HttpCLient实现对被GZip压缩过的Response进行解压
- HttpCLient实现对被GZip压缩过的Response进行解压
- HttpCLient实现对被GZip压缩过的Response进行解压
- HttpCLient实现对被GZip压缩过的Response进行解压
- 劫持事件处理中针对gzip压缩数据包的处理
- tomcat的gzip压缩
- pythn的gzip压缩
- Python—HTTP处理Gzip压缩数据
- gzip 压缩格式的网站处理方法---sina.com
- gzip压缩的数据如何在内存中解压
- 使用GZIP压缩的方式向客户端传输响应数据
- 使用zlib实现gzip格式数据的压缩和解压
- 使用zlib实现gzip格式数据的压缩和解压
- 向客户端浏览器发送压缩后的数据(gzip)
- ORA-19815-Oracle11g RAC 停机
- poj 3414 Pots 广搜(链式存储)
- 可可肉的逻辑题---(五)数太大了怎么办?
- 黑盒测试和白盒测试区别
- C语言课程-C语言文件操作
- 处理被Gzip的压缩过的数据
- 非常感人的情感日志:这些话看哭了很多人
- cronExpression表达式解释:
- Oracle中的数据库对象管理
- 人教新课标 小学一年级数学下册 教学视频
- NodeJS 常用模块推荐
- Ehcache二级缓存使用和不使用,iterate()方法查询的sql语句对比
- 黑马程序员----Java高新技术2
- ADO.NET 数据连接查询