public static void copyFile(File sourceFile,File destinationFile) Throws IOException{
if(!sourceFile.exists()){
return;
}
InputStream inputStream = new FileInputStream(sourceFile);
OutputStream outputStream = new FileOutputStream(destinationFile);
byte[] buffer = new byte[2048];
int length = 0;
while((length = inputStream.read(buffer)) > 0){
outputStream.write(buffer,0,length);
}
inputStream.close();
outputStream.close();
}
复制文件本文访问次数:0