当前位置:网站首页>读取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());
}
边栏推荐
- IO进程线程->文件IO->day2
- 【markdown常用用法】
- 独立按键控制led进阶(1)
- rsync使用方法之坑
- Real-time waveform display of CAN communication data based on QT (serial eight) ==== "Sub function or new class calls ui control"
- 基于STM32F103的消防系统之MQ-4气体传感器
- IO进程线程->标准IO->day1
- Biotin-NH2|CAS:111790-37-5(生物素-氨基)是一种生物素化化合物
- VsCode连接远程服务器并修改文件代码
- 单片机之流水灯
猜你喜欢
随机推荐
[Jiangsu University Automation Association stm32F103c8t6] Notes [Initial 32 MCU and EXTI External Interrupt Initialization Parameter Configuration]
Knowledge of the day: handwritten deep copy and shallow copy (solves the problem of circular references)
数码管动态显示及模块化编程
比尔·盖茨买百万亩农地成美“头号地主”,图扑数字孪生农场
测试第二题
------实现二叉搜索树BST
D-Desthiobiotin Amine_D-脱硫生物素-胺相关的产品性质
矩阵键盘
VsCode连接远程服务器并修改文件代码
无法完成包的安装npm ERR! Refusing to install package with name “moment“ under a package also called “moment“
动态规划入门 JS
表格比手机屏幕宽时不压缩,可左右滚动,格子内容不换行
Jenkins一些常见问题
图扑软件数字孪生民航飞联网,构建智慧民航新业态
Biotin-NH2|CAS:111790-37-5(生物素-氨基)是一种生物素化化合物
STM32F103连接L9110S电机驱动控制小水泵
Written before the official account - QT, ARM, DSP, microcontroller, power electronics and transmission!
图扑数字孪生煤矿开采系统,打造采煤“硬实力”
给Vscode配置ESlint语法检查 — ESLint 插件自动格式化设置(实现Ctrl+S 按照ESLint规则自动格式化代码)
【部分项目展示】