DictionaryReader.java 文件源码

java
阅读 44 收藏 0 点赞 0 评论 0

项目:r8 作者:
public static ImmutableList<String> readAllNames(Path path) {
  if (path != null) {
    Builder<String> namesBuilder = new ImmutableList.Builder<String>();
    try (DictionaryReader reader = new DictionaryReader(path);) {
      String name = reader.readName();
      while (!name.isEmpty()) {
        namesBuilder.add(name);
        name = reader.readName();
      }
    } catch (IOException e) {
      System.err.println("Unable to create dictionary from file " + path.toString());
    }
    return namesBuilder.build();
  } else {
    return ImmutableList.of();
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号