1.Java问题readline?
Java问题readline?
你的源码代码已经报错了,这个是源码黑猫源码分享按行读取文件。InputStream inputStream = getClass().getClassLoader().getResourceAsStream("test.txt");
源码源码窗口StringBuilder resultStringBuilder = new StringBuilder();
源码源码窗口try (BufferedReader br
源码源码窗口= new BufferedReader(new InputStreamReader(inputStream))) {
源码源码窗口String line;
源码源码窗口while ((line = br.readLine()) != null) {
源码源码窗口resultStringBuilder.append(line).append("\n");
源码源码窗口}
源码源码窗口}
源码源码窗口System.out.println(resultStringBuilder.toString());
源码源码窗口