- package lks.lianxi;
- import java.io.IOException;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- public class FileInputStreamDemo1 {
- public static void main(String[] args)throws IOException {
- //数据源
- FileInputStream fis = new FileInputStream("ez.jpg");
- //目的地
- FileOutputStream fos = new FileOutputStream("EZ.jpg");
-
- byte[] bys = new byte[1024];
- int len =-1;
- while((len=fis.read(bys))!=-1){
- fos.write(bys,0,len);
- }
- fos.close();
- fis.close();
- }
- }
复制代码
为什么复制到当前路径的图片 复制不了呢? |
|