飙血推荐
  • HTML教程
  • MySQL教程
  • JavaScript基础教程
  • php入门教程
  • JavaScript正则表达式运用
  • Excel函数教程
  • UEditor使用文档
  • AngularJS教程
  • ThinkPHP5.0教程

java 写文件

时间:2021-11-10  作者:匿名  
try{
            String fileName = "域名";//指定文件名
            File file = new File(fileName);
            FileOutputStream out = new FileOutputStream(file);//建立输出流
            byte[] b = new byte[1024];
            String str = "Nice to see you again!";
            b = 域名ytes();//String转化为byte[]
            域名e(b);//写入文本内容
        }
        catch(IOException e){
            域名tln(域名ring());
        }
标签:文件java
湘ICP备14001474号-3  投诉建议:234161800@qq.com   部分内容来源于网络,如有侵权,请联系删除。