我希望实现以下目标:
BufferedInputStream is = new BufferedInputStream(System.in);
int c = 0;
while((c=is.read())!=-1)
Files.copy(is, path3, StandardCopyOption.REPLACE_EXISTING);胡佛它永远被困在等待System.in中..有什么解决方法吗?
提前谢谢。
发布于 2013-08-06 23:19:24
如果你正在尝试停止阅读换行符、回车符或结束流,你可以尝试-
do {
try {
c = is.read();
// Do something
} catch (IOException e) {
e.printStackTrace();
}
} while ((c != -1) & (c != '\n') & (c != '\r'));https://stackoverflow.com/questions/18082900
复制相似问题