java增量写

private void writeFile(String content){
    BufferedOutputStream out = null;
        try {
            out = new BufferedOutputStream(new FileOutputStream("D:\\java\\log\\1.log",true));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        try {
            out.write(content.getBytes());
            out.flush();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
}    

  

posted @ 2019-07-09 10:47  卡拉迦迪斯  阅读(397)  评论(0编辑  收藏  举报