java文件复制

来源:互联网 发布:python 或者 编辑:程序博客网 时间:2024/05/22 02:02
//文件复制public class Copy {public static void main(String[] args) throws Exception {InputStream is = new FileInputStream("d:\\c2.jpg");OutputStream os = new FileOutputStream("d:\\c2-副件.jpg");byte[] buf = new byte[1024];int len=0;while((len=is.read(buf))>0){os.write(buf, 0, len);}is.close();os.close();}}

0 0
原创粉丝点击