问题,最近在部分手机上利用HttpURLConnection 去下载文件,通过getContentLength(); 获取文件大小发现为 -1 解决方法 请求head设置属性 setRequestProperty("Accept-Encoding", "identity");