package homework;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopyPhoto {
public static void main(String[] args) {
FileInputStream fis;
FileOutputStream fos;
byte[] buffer = new byte[1024];
int ll;
try {
fis = new FileInputStream("/Users/xalo/Desktop/a.gif");
fos = new FileOutputStream("/Users/xalo/Desktop/a1.gif");
while ((ll = fis.read(buffer)) > 0) {
fos.write(buffer, 0, ll);
}
fis.close();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopyPhoto {
public static void main(String[] args) {
FileInputStream fis;
FileOutputStream fos;
byte[] buffer = new byte[1024];
int ll;
try {
fis = new FileInputStream("/Users/xalo/Desktop/a.gif");
fos = new FileOutputStream("/Users/xalo/Desktop/a1.gif");
while ((ll = fis.read(buffer)) > 0) {
fos.write(buffer, 0, ll);
}
fis.close();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}