阅读带有缓冲阅读器的输入流后,如何摆脱循环
嗨,我正在通过作业学习套接字编程,我正在尝试使用缓冲读取器读取我的JSON字符串,但以某种方式(((line = br.readline())!= null在我的while循环中只返回true,我认为我认为保持我在循环中即使阅读了
我该如何解决
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
}
Hi I'm learning socket programming through an assignment, I'm trying to read my json string using buffered reader but somehow ((line = br.readLine()) != null) in my while loop only returns true which i think keeps me in the loop even after reading
how can i solve
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论