Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我设法通过
Files.copy(Paths.get(file.toURI()), System.out);
如何将一系列字符写入文件?我没有看到任何影响
Files.copy(new ByteArrayInputStream(content.getBytes()), Paths.get(file.getName()))
它看起来很丑。
我已经成功了
Files.write(Paths.get(file.getName()), content.getBytes());