zoukankan      html  css  js  c++  java
  • iostream

    package com.cust.wu;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.FileWriter;




    public class zifu {
    public static void main(String[] args){
        int n;
        try{
            FileReader fr=new FileReader("d:/test.txt");
            FileWriter fw=new FileWriter("e:/test.txt");
            char[] buffer=new char[10];
            while(( n =fr.read(buffer,0,10))!=-1){
                System.out.println(buffer);
                fw.write(buffer,0,n);
            }
            
        }
        catch(FileNotFoundException t){
            System.out.println("not found");
        }
        catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }
    }

        

    }











    package com.cust.wu;

    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;

    public class iostream {
        public static void main(String[] args){
            int n;
            try{
                File f = new File("D:/test.jpg");
                FileInputStream fis =new FileInputStream(f);
                FileOutputStream fos= new FileOutputStream("e:/test.jpg");
                byte[] buffer=new byte[10];
                while((n=fis.read(buffer,0,10))!=-1){
                    fos.write(buffer,0,n);
                    
                }
            }
            catch (FileNotFoundException t) {
                System.out.println("not found");
                // TODO: handle exception
            }
             catch (Exception e) {
                // TODO: handle exception
                 e.printStackTrace();
            }
            
        }


    }


  • 相关阅读:
    2017北京网络赛 J Pangu and Stones 区间DP(石子归并)
    2017北京网络赛 F Secret Poems 蛇形回路输出
    2017 北京网络赛 E Cats and Fish
    CF 1198 A. MP3 模拟+滑动窗口
    博弈论
    gym 101911
    容器STL
    POJ 3281 Dining 最大流+拆点
    hdu 1533 Going Home 最小费用最大流 (模板题)
    C#博文搜集
  • 原文地址:https://www.cnblogs.com/helloaworld/p/6048176.html
Copyright © 2011-2022 走看看