LocalFileReader.java 文件源码

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

项目:protostuff-compiler 作者:
@Nullable
@Override
public CharStream read(String name) {
    for (Path prefix : pathList) {
        Path path = prefix.resolve(name);
        if (Files.isRegularFile(path)) {
            try {
                byte[] bytes = Files.readAllBytes(path);
                String result = new String(bytes, StandardCharsets.UTF_8);
                return CharStreams.fromString(result);
            } catch (IOException e) {
                LOGGER.trace("Could not read {}", path, e);
            }
        }
    }
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号