【发布时间】:2012-05-16 14:57:08
【问题描述】:
我在 Android 中使用 BufferedReader 接收 http 流连接,解析消息时收到使用代码:
url = new URL(HOST_URL_PUSHMESSAGE);
urlConnection = url.openConnection();
in = (InputStream) urlConnection.getContent();
reader = new BufferedReader(new InputStreamReader(in));
line = reader.readLine();
in.close();
它看起来运行良好,但有时我得到 IOException - 预期为十六进制块大小,但... 发生在:
line = reader.readLine();
这是如何发生的?如何解决? 更改缓冲阅读器大小有帮助吗? 谢谢
【问题讨论】:
标签: java android readline bufferedreader ioexception