Skip to content

Commit 883faf8

Browse files
authored
Merge pull request #409 from deepktp/master
Fix download issue with file size 2GB+
2 parents 3cd2416 + a046810 commit 883faf8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

android/src/main/java/com/ReactNativeBlobUtil/Response/ReactNativeBlobUtilFileResp.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,19 @@ public MediaType contentType() {
7272

7373
@Override
7474
public long contentLength() {
75-
if (originalBody.contentLength() > Integer.MAX_VALUE) {
75+
76+
/**
77+
*
78+
* Okio buffer issue in current version seems to be fixed in the latest versions
79+
*
80+
* limiting this was causing the download progress to stop at 2GB size but files still was downloading
81+
*
82+
*/
83+
84+
// if (originalBody.contentLength() > Integer.MAX_VALUE) {
7685
// This is a workaround for a bug Okio buffer where it can't handle larger than int.
77-
return Integer.MAX_VALUE;
78-
}
86+
// return Integer.MAX_VALUE;
87+
// }
7988
return originalBody.contentLength();
8089
}
8190

0 commit comments

Comments
 (0)