This line does not compile Files.list(Paths.get("/secret")).forEach(x -> Files.write(x, new byte[Files.size(x)]); because Files.write() and Files.size() throw IOE. Then what's the best way to make it work? (I find some old threads on this on lambda-dev. Maybe we have a recommended way now?) Thanks Max