【发布时间】:2019-01-30 22:42:13
【问题描述】:
所以我在使用 bufferedReader 中的 readLine() 方法保存值时遇到了问题,这是我的代码当前的样子:
in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
while((inputLine=in.readLine())!= null)
try { g.doc.insertString(g.doc.getLength(), "\n" + new Xmlgetter(inputLine).outString, g.style);
}
catch (BadLocationException e){
e.printStackTrace();
}
我想要实现的是能够两次使用 inputLine 的值。我遇到的问题是无论我如何尝试保存它,我都会调用 in.readLine(),第二次调用它时它是空的。想法?
【问题讨论】:
标签: java inputstream bufferedreader