简单写入:
File file = new File("G:\\870_2_Files\\Test\\os.txt"); String s = "123"; OutputStream os = Files.newOutputStream(file.toPath()); os.write(s.getBytes(StandardCharsets.UTF_8)); os.close();
删除:
File file = new File("G:\\870_2_Files\\Test\\os.txt"); file.delete();