equivalent to Files.readAllLines() for InputStream or Reader?

后端 未结 2 850
忘了有多久
忘了有多久 2021-02-02 05:48

I have a file that I\'ve been reading into a List via the following method:

List doc = java.nio.file.Files.readAllLines(new File(\"/path/to/src/res         


        
2条回答
  •  眼角桃花
    2021-02-02 06:38

    You can use Apache Commons IOUtils#readLines:

    List doc = IOUtils.readLines(inputStream, StandardCharsets.UTF_8);

提交回复
热议问题