[M2] 1、视频下载优化

This commit is contained in:
wangmingjun
2023-03-08 15:34:38 +08:00
parent 39afcde96c
commit 96256811a9
3 changed files with 20 additions and 19 deletions

View File

@@ -5,7 +5,6 @@ import static com.mogo.eagle.core.utilcode.breakpoint.Config.DOWN_LOAD_TAG;
import android.util.Log;
import com.mogo.eagle.core.utilcode.breakpoint.Config;
import com.mogo.eagle.core.utilcode.breakpoint.bean.FileBean;
import com.mogo.eagle.core.utilcode.breakpoint.bean.ThreadBean;
import com.mogo.eagle.core.utilcode.breakpoint.callback.DownloadCallBack;
@@ -51,7 +50,7 @@ public class DownloadThread extends Thread {
int start = threadBean.getStart() + threadBean.getFinished();
connection.setRequestProperty("Range","bytes="+start+"-"+threadBean.getEnd());
//设置写入位置
File file = new File(fileBean.getFileName().contains(".zip") ? Config.downLoadObuPath : Config.downLoadPath,fileBean.getFileName());
File file = new File(fileBean.getSavePath(),fileBean.getFileName());
raf = new RandomAccessFile(file,"rwd");
raf.seek(start);
//开始下载