package a.ab; import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException; public class ClassA {
public static void main(String[] args) {
try {
FileInputStream fis = new FileInputStream(
"C:\\Program Files\\feiq\\Recv Files\\001.jpg");
FileOutputStream fos = new FileOutputStream(
"C:\\Program Files\\feiq\\Recv Files\\003.jpg");
int len = 0;
byte[] bytes = new byte[1024];
try {
while ((len = fis.read(bytes)) != -1) {
fos.write(bytes, 0, len);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} }
}