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);
|
int count = input.read(buffer);
|
||||||
throwExceptionIfInterrupted();
|
throwExceptionIfInterrupted();
|
||||||
|
|
||||||
bytesRead += count;
|
|
||||||
sendProgress(bytesRead, totalBytes);
|
|
||||||
if (count == -1) {
|
if (count == -1) {
|
||||||
Log.d(TAG, "Finished downloading from stream");
|
Log.d(TAG, "Finished downloading from stream");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
bytesRead += count;
|
||||||
|
sendProgress(bytesRead, totalBytes);
|
||||||
outputStream.write(buffer, 0, count);
|
outputStream.write(buffer, 0, count);
|
||||||
}
|
}
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user