package javaapplication1;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class JavaApplication1 {
public static void main(String[] args) {
String sSource = "d://Img_1973.jpg";
String sDestination = "d://Img_1973_Backup.jpg";
try {
FileOutputStream fos;
try (FileInputStream fis = new FileInputStream(sSource)) {
fos = new FileOutputStream(sDestination);
byte[] b = new byte[1024];
int totalBytes = 0;
while ((totalBytes = fis.read(b)) != -1) {
fos.write(b, 0, totalBytes);
}
}
} catch (IOException ioe) {
System.out.println(ioe);
}
}
}
// check your directory for destination file
/*
run:
*/