欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

java写入文件,

来源: javaer 分享于  点击 7398 次 点评:110

java写入文件,


 

public void write(String str_ssr, String url) {
        //把值读入到文件中
        BufferedOutputStream bos = null;
        File file = null;
        try {

            file = new File(url);//https://192.168.20.10/svn/bioc/trunk/OPT
            bos = new BufferedOutputStream(new FileOutputStream(file));
            byte[] date = str_ssr.getBytes("utf-8");
            if (true) {
                bos.write(date);
            }
        } catch (IOException ie) {
            ie.printStackTrace();
        } finally {
            try {
                bos.close();
            } catch (IOException ie) {
                ie.printStackTrace();
            }
        }
    }

相关文章

    暂无相关文章
相关栏目:

用户点评