public static void copyFile(String src,String dest){
File fileIs = new File(src);
File fileOs = new File(dest);
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(fileIs);
fos = new FileOutputStream(fileOs);
byte[] b = new byte[1024];
int len;
while((len = fis.read(b)) != -1){
fos.write(b,0,len);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
if(fos != null){
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(fis != null){
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
File fileIs = new File(src);
File fileOs = new File(dest);
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(fileIs);
fos = new FileOutputStream(fileOs);
byte[] b = new byte[1024];
int len;
while((len = fis.read(b)) != -1){
fos.write(b,0,len);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
if(fos != null){
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if(fis != null){
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}