public class Seventh {
public static void main(String[] args) {
FileInputStream fis = null;
FileOutputStream fos = null;
try{
fis = new FileInputStream("D:\\heima\\psb.jpg");
fos = new FileOutputStream("F:\\luoli.jpg");
byte[] bytes = new byte[1024];
int len;
while ((len = fis.read(bytes)) != -1){
fos.write(bytes,0,len);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} 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();
}
}
}
}
}