乐趣区

关于java:java8-stream方式读取文件

`

@Test
public void readFile() throws IOException {
     String fileName = "F:/sdata 企业名.txt";
     // 读取文件
     Stream<String> stringStream = Files
                .lines(Paths.get(fileName), Charset.defaultCharset());
     stringStream.limit(10000).forEach(line -> {System.out.println(line.replace("",""));
     });
}

`

退出移动版