当前位置:网站首页>读取GZ包的内容代码
读取GZ包的内容代码
2022-07-30 05:48:00 【paj123456789】
public static void main(String[] args) {
String uri = "https://download.tim.qq.com/msg_history/4/bb2a91f4097a0747ab4a11ec8724b8cef6d20907.gz";
StringBuffer sb = null;
try
{
URL url = new URL(uri);
URLConnection conn = url.openConnection();
final InputStream inputStream = conn.getInputStream();
final GZIPInputStream gzip = new GZIPInputStream(inputStream);
final InputStreamReader reader = new InputStreamReader(gzip);
final BufferedReader bufferedReader = new BufferedReader(reader);
sb = new StringBuffer();
String content=null;
while ((content = bufferedReader.readLine()) != null) {
sb.append(content);
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(sb.toString());
}
边栏推荐
- C 语言之学生管理系统-多文件编程
- ---------手撕二叉树,完成二叉树的前中后序遍历,以及前中后序查找
- vscode set sublime theme
- 每日一知识:手写深拷贝和浅拷贝(解决了循环引用的问题)
- 二、1稀疏sparsearray数组
- 2020-09-03 Solve the very slow installation of pip install [Errno 101] Network unreachable problem
- 51数码管显示
- Real-time waveform display of CAN communication data based on QT (serial eight) ==== "Sub function or new class calls ui control"
- Biotin-PEG4-SS-Alkyne_1260247-54-8_生物素-PEG4-SS-炔烃
- MindSpore 提 PR 全流程
猜你喜欢
随机推荐
基于STM32F103的消防系统之驱动电机风扇
PC DBCO-PEG3-Biotin|PC-生物素-PEG3-DBCO可用于使用无铜点击化学
Antd简单启动一个企业级项目
vscode set sublime theme
IO进程线程->标准IO->day1
基于精灵(Sprite)管道烟雾流动效果
Unity Shader 空间坐标系
使用Dva项目作Antd的Demo
测试第二题
Biotin-PEG4-SS-Alkyne_1260247-54-8_生物素-PEG4-SS-炔烃
Acwing刷题第一节
C language, usage of qsort in library function, and explanation
力扣题解7.27
[Quick MSP430f149] Notes on learning MSP430f149 during the game
测试第一题
Biotin-NH2|CAS:111790-37-5(生物素-氨基)是一种生物素化化合物
mysql数据库怎么设置手动提交
IO进程线程->目录IO->day3
实现二叉树--实现删除
力扣题解









