package org.demo;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class IODemo {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
//拷贝图片
File file=new File("D:\\aa.jpg");
FileInputStream fis=new FileInputStream(file);
FileOutputStream fos=new FileOutputStream("D:\\copyaa.jpg");
byte b[]=new byte[(int)file.length()];
fis.read(b);
fos.write(b);
System.out.println("图片copy成功");
}
}
使用IO流拷贝图片
最新推荐文章于 2023-02-13 12:42:12 发布