InputStreamReader returns 只有一半 html 文件

InputStreamReader returns only half of the html Document

我正在构建一个从网站获取图像的应用程序。 当我获取网页的 html 时,InputStreamReader 只获取了一半的网页。 花了太多时间寻找解决方案,但 none 建议如何解决问题。 任何帮助表示赞赏。 谢谢。

这是MainActivity.java https://gist.github.com/sujayss81/e4237916c605be223c673af7cf8f40d4

这是日志

https://gist.github.com/sujayss81/774472fe274e7cf9ebfdd0388c3e3ab5

代码正确获取了整个网页。但是 Log.i("Result",result); 的输出被截断了。

所以如果你想增加这个限制,请参考这些问题:

  • Android - Set max length of logcat messages
  • How to display long messages in logcat
  • What is the size limit for Logcat and how to change its capacity?