MCPcopy Index your code
hub / github.com/Bit0r/java-util / writeToFile

Method writeToFile

src/main/java/util/AddTableField.java:81–94  ·  view source on GitHub ↗

写入文件 @param fileName @param s @throws IOException

(String fileName, String s)

Source from the content-addressed store, hash-verified

79 * @throws IOException
80 */
81 public static void writeToFile(String fileName, String s) throws IOException {
82 File f1 = new File(fileName);
83 OutputStream out = null;
84 BufferedWriter bw = null;
85 if (f1.exists()) {
86 out = new FileOutputStream(f1);
87 bw = new BufferedWriter(new OutputStreamWriter(out, "utf-8"));
88 bw.write(s);
89 bw.flush();
90 bw.close();
91 } else {
92 System.out.println("文件不存在");
93 }
94 }
95
96 /**
97 * 追加文件

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected