Reading entire html file to String?

后端 未结 7 1067
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 09:56

Are there better ways to read an entire html file to a single string variable than:

    String content = \"\";
    try {
        BufferedReader in = new Buff         


        
7条回答
  •  粉色の甜心
    2020-12-05 10:10

    There's the IOUtils.toString(..) utility from Apache Commons.

    If you're using Guava there's also Files.readLines(..) and Files.toString(..).

提交回复
热议问题