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

fix Android downloadFile overflow contentLength and bytesWritten #583

Merged

Conversation

jonnynfb
Copy link
Contributor

@jonnynfb jonnynfb commented Nov 15, 2018

On Android downloadFile will get overflown and contentLength return -1 if downloading large size file over 3GB.
I switched to use long instead of int; and using getContentLengthLong instead of getContentLength to support big file size.

The content length of the resource that this connection's URL references, -1 if the content length is not known, or if the content length is greater than Integer.MAX_VALUE.
https://docs.oracle.com/javase/7/docs/api/java/net/URLConnection.html#getContentLength()

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

Successfully merging this pull request may close these issues.

2 participants