爱问知识人 爱问教育 医院库

谁能java.io?

首页

谁能java.io?

谁能java.io.File写入写出的一个简单实例吗?

提交回答

全部答案

    2018-03-28 12:05:54
  •   import java。io。File;
    import java。io。FileInputStream;
    import java。io。FileNotFoundException;
    import java。io。FileOutputStream;
    import java。
      io。IOException; public class TestIO { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub byte[] b = new byte[17*1024]; // ** txt // File f = new File("d:\\test。
      txt"); // File outF = new File("d:\\testOut。txt"); // ** jpg File f = new File("d:\\毫无保留。jpg"); File outF = new File("d:\\毫无保留Output。
      jpg"); try { FileInputStream fis = new FileInputStream(f); FileOutputStream fops = new FileOutputStream(outF); fis。read(b); fops。
      write(b); // ** for see // String s = new String(b); // System。out。println(s); fis。close(); fops。close(); } catch(FileNotFoundException fnfe) { System。
      out。println("FileNotFoundException fnfe"); fnfe。printStackTrace(); } catch(IOException ie) { System。out。println("IOException ie"); ie。
      printStackTrace(); } } }。

    宋***

    2018-03-28 12:05:54

类似问题

换一换
  • 系统软件 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新资料 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):