我将从Java 8开始学习Java的NIO课程。
Path dataPath = FileSystems.getDefault().getPath("SomeFile");
Files.write(dataPath,"\n Hello".getBytes("UTF-8"), StandardOpenOption.APPEND);
和
Path dataPath = FileSystems.getDefault().getPath("SomeFile");
BufferedWriter locFile = Files.newBufferedWriter(dataPath);
locFile.write("\n Hello");
是不是我们用Bytes with Files.write()和使用BufferedWriter来直接写文本?