码迷,mamicode.com
首页 > 其他好文 > 详细

【复制文本文件】

时间:2018-11-11 01:04:25      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:puts   span   copyfile   pac   des   ati   file   str   .com   

package test;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author shusheng
 * @description 复制文本文件
 * @Email shusheng@yiji.com
 * @date 2018/11/9 17:23
 */
public class CopyFileDemo1 {

    public static void main(String[] args) throws IOException {

        FileInputStream fis = new FileInputStream("fos.txt");
        FileOutputStream fos = new FileOutputStream("fis.txt");

        int by = 0;
        while((by=fis.read())!=-1){
            fos.write(by);
        }

        fis.close();
        fos.close();

    }

}

 

【复制文本文件】

标签:puts   span   copyfile   pac   des   ati   file   str   .com   

原文地址:https://www.cnblogs.com/zuixinxian/p/9941138.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!