Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于项目中getCRC32函数和getHttpFileEtag函数的问题 #8

Open
GJZ0117 opened this issue Oct 21, 2023 · 0 comments
Open

关于项目中getCRC32函数和getHttpFileEtag函数的问题 #8

GJZ0117 opened this issue Oct 21, 2023 · 0 comments

Comments

@GJZ0117
Copy link

GJZ0117 commented Oct 21, 2023

您好,我最近想要学习下多线程断点续传的相关内容,看到您写的这个小项目,感觉特别棒
项目中DownloadMain.java中的函数getCRC32和HttpUtils.java中的函数getHttpFileEtag貌似并没有被使用
通过阅读您的微信文章和查阅网上资料,了解到这两个函数应该是用于对下载的临时文件进行校验的,但项目中没有引用是否说明在下载完成每段临时文件后没有校验呢?
我的想法是直接声明一个变量存储第一段临时文件的Etag,当下一段临时文件下载完成后,如果它的Etag和前一个Etag不同,就说明发生了改变,下载失败,提示信息并删除已下载的临时文件。不知道这样编写代码可否?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant