A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

import java.io.*;
class IOTest
{
        public static void main(String[] args) throws Exception
        {
                BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("F:\\TestJava\\IO流\\FileInputStream和FileOutputStream\\瑞安家园设计方案专题.jpg"));
            BufferedInputStream bis = new BufferedInputStream(new FileInputStream("E:\\Users\\lin\\Pictures\\Camera Roll\\瑞安家园设计方案专题.jpg"));
                byte[]  bytes = new byte[1024];
                int len = 0;
                while((len=bis.read(bytes))!=-1)
                {
                        bos.write(bytes,0,len);
                }
                System.out.println("复制成功");
                bis.close();
                bos.close();
        }
}

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马