保存文件内容
程序员文章站
2022-06-07 18:36:12
...
public class SaveDocument {
public static void main(String[] args) {
try {
String content = "content";
byte[] bytes = str.getBytes("utf-8");
FileOutputStream fos= new FileOutputStream("director");
fos.write(bytes);
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}