try {
FileInputStream fileInputStream=new FileInputStream("D:\\Jellyfish.jpg");
FileOutputStream fileOutputStream=new FileOutputStream("D:\\new.jpg");
int len=0;
byte temp []=new byte[1024*8];;
while((len=fileInputStream.read(temp))!=-1){
System.out.println("len="+len);
fileOutputStream.write(temp,0,len);
}
fileOutputStream.close();
fileInputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
java使用io流实现简单的文件复制
最新推荐文章于 2022-06-11 10:45:06 发布