Don't add count=-1 to bytesRead when finished
This commit is contained in:
parent
29403c1d84
commit
38ab8ac353
@ -173,12 +173,12 @@ public abstract class Downloader {
|
||||
int count = input.read(buffer);
|
||||
throwExceptionIfInterrupted();
|
||||
|
||||
bytesRead += count;
|
||||
sendProgress(bytesRead, totalBytes);
|
||||
if (count == -1) {
|
||||
Log.d(TAG, "Finished downloading from stream");
|
||||
break;
|
||||
}
|
||||
bytesRead += count;
|
||||
sendProgress(bytesRead, totalBytes);
|
||||
outputStream.write(buffer, 0, count);
|
||||
}
|
||||
outputStream.flush();
|
||||
|
Loading…
x
Reference in New Issue
Block a user