首页 > 编程语言 > 详细

7.5java IO

时间:2019-07-05 13:09:18      阅读:104      评论:0      收藏:0      [点我收藏+]
import java.io.*;
 
 public class ccc {
 
     public static void main(String[] args) throws IOException{
         String str="12345abcde@#%&*软件工程";
         File file=new File("d:\\tset.txt");
         file.createNewFile();
         FileInputStream fr=new FileInputStream(file);
         FileOutputStream fw=new FileOutputStream(file);
         byte[]bw=str.getBytes();
         fw.write(bw);
         byte[]br=str.getBytes();
         fr.read(br);
         String str$=new String(br);
         System.out.println(str$);
         fr.close();
         fw.close();
     }
 
 }

 

7.5java IO

原文:https://www.cnblogs.com/huangjiaxin/p/11136992.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!