Java字符串导出指定格式文件

public static boolean writeXml(){

        String filePath = "E:\\\\IdeaProjects\\\\demo\\\\src\\\\main\\\\resources\\\\static\\\\file\\\\";
        String xml = "111111111111111111111111111111111111111111";

        try {
            FileWriter fw = new FileWriter(filePath+"demo.xml", true);
            BufferedWriter bw = new BufferedWriter(fw);
            bw.append(xml);
            bw.close();
            fw.close();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
上一篇:缓冲字符流


下一篇:5.20Java字符缓冲流--->处理纯文本