android http gzip,java - Android HttpURLConnection: gzip compression - Stack Overflow

I can't understand what the documentation says about that.

By default, this implementation of HttpURLConnection requests that servers use gzip compression. Since getContentLength() returns the number of bytes transmitted, you cannot use that method to predict how many bytes can be read from getInputStream(). Instead, read that stream until it is exhausted: when read() returns -1. Gzip compression can be disabled by setting the acceptable encodings in the request header:

urlConnection.setRequestProperty("Accept-Encoding", "identity");

I would like to know if the current implementation actually decompress the stream before returning it (using conn.getInputStream()) or if it simply says that the connection automatically sends the header for gzip encoding and I need to manage with that.

Thanks.

内容概要:本文深入探讨了Linux内核开发调试方法框架,全面覆盖了从前期准备到具体调试工具和技术的应用。文章首先介绍了Linux内核的重要性及其开发挑战,强调了调试在内核开发中的关键作用。随后,详细阐述了调试前的必备工作,包括确认bug的存在、了解内核版本号、深入理解内核代码、确保bug可复现以及最小化系统。接着,文章介绍了内核调试配置选项,如“Magic SysRq key”和“Kernel debugging”等关键配置项,以及调试原子操作的设置。在引发bug与打印信息方面,讲解了BUG()和BUG_ON()宏、dump_stack()函数的作用,并深入解析了printk()函数的健壮性、局限性及LOG等级设定。文件系统如procfs、sysfs和debugfs在调试中的应用也被详细说明。最后,介绍了ftrace与trace-cmd、kprobe与systemtap、KGDB与KGT等调试工具和技术。; 适合人群:具备一定Linux基础知识和编程经验的研发人员,尤其是从事操作系统开发、内核优化或嵌入式系统开发的工程师。; 使用场景及目标:①帮助开发者在内核开发过程中快速定位和解决bug;②提升对内核代码的理解,掌握内核调试的常用工具和方法;③通过实际案例和具体技术手段,提高内核开发的效率和稳定性。; 其他说明:本文不仅提供了理论知识,还结合了大量实际案例和具体操作步骤,旨在帮助读者全面掌握Linux内核调试的精髓。随着技术的进步,未来内核调试有望借助AI和机器学习实现智能化和自动化,进一步提升调试效率。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值