//把文件从一个地方复制到另一个地方
public void mCopyFile(File fromFile, File toFile){
try {
FileInputStream fosfrom = new FileInputStream(fromFile);
FileOutputStream fosto = new FileOutputStream(toFile);
byte bt[] = new byte[1024*1024];
int c;
while((c = fosfrom.read(bt)) > 0){
fosto.write(bt, 0, c);
}
fosfrom.close();
fosto.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
Log.i("复制文件异常", e.toString());
} catch (IOException e) {
// TODO Auto-generated catch block
Log.i("复制文件异常", e.toString());
}
}
File fromFile = new File("/mnt/sdcard/downvideo/");
File toFile = new File("/mnt/sdcard/video/");
mCopyFile(fromFile,toFile);//把下载好的文件复制到正在播放列表
记得添加权限