Commit 2a4fe134 authored by 张永's avatar 张永

加个方法

parent 56b6da36
...@@ -9,6 +9,7 @@ import java.io.File; ...@@ -9,6 +9,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
...@@ -594,4 +595,15 @@ public class FileUtil { ...@@ -594,4 +595,15 @@ public class FileUtil {
} }
} }
} }
public static void appendMethod(String fileName, String content) {
try {
//打开一个写文件器,构造函数中的第二个参数true表示以追加形式写文件
FileWriter writer = new FileWriter(fileName, true);
writer.write(content+"\n");
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment