本帖最后由 AfterSeptember 于 2014-02-27 20:42:19 编辑

解决方案 »

  1.   


    是请求数据的问题,数据请求是"gzip"压缩的,所以fileLength返回-1。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: whenread() returns -1.