利用org.apache.commons.io.FileUtils快速读写文件

利用org.apache.commons.io.FileUtils快速读写文件
String fileName = "C://11.txt";
  File file = new File(fileName);
  String fileContent = "";
  try {
   fileContent = org.apache.commons.io.FileUtils.readFileToString(file, "GBK");
  } catch (IOException e) {
   e.printStackTrace();
  }
  fileContent +="Helloworld";
  try {
   org.apache.commons.io.FileUtils.writeStringToFile(file, fileContent, "GBK");
  } catch (IOException e) {
   e.printStackTrace();
  }


你可能感兴趣的:(apache,C++,c,qq,C#)