Java:追加文件内容

文章来源:https://www.cnblogs.com/hello-tl/p/9139367.html

import java.io.*;

public class FileBasicOperation {
/**
* 文件追加内容
* @param file 文件地址
* @param conent 内容
*/
public static void fileAdditionalContent(String file, String conent) {
BufferedWriter out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(file, true)));
out.write(conent);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

文章来源:https://www.cnblogs.com/hello-tl/p/9139367.html

上一篇:在Jetson TX2上捕获、显示摄像头视频


下一篇:shell ssh 远程机器 追加文件内容