import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopyPngDemo {
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream("D:\\MyProject\\Java\\LearnJava1\\src\\Demo4\\img.png");
FileOutputStream fos = new FileOutputStream("D:\\MyProject\\Java\\LearnJava1\\src\\Demo4\\img2.png");
byte[] bys = new byte[1024];
int len;
while ((len = fis.read(bys)) != -1) {
fos.write(bys);
}
fos.close();
fis.close();
}
}