2020年9月25日

【踩坑记事】大量文件处理时,java.nio.file.Files.list导致“打开的文件太多”

摘要: 错误的用法 Files.list(directory).forEach(path -> { // do }); 正确的用法 try (Stream<Path> stream = Files.list(directory)) { stream.forEach(path -> { // do }); } 阅读全文

posted @ 2020-09-25 10:15 小小程序员的梦想 阅读(910) 评论(0) 推荐(0) 编辑

导航