mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 00:34:20 +03:00
Исправлено возможное переполнение в downloader
This commit is contained in:
parent
d902fe550a
commit
926ae52815
@ -63,7 +63,7 @@ public final class downloader implements Module {
|
|||||||
os.write(buffer, 0, readed);
|
os.write(buffer, 0, readed);
|
||||||
downloaded += readed;
|
downloaded += readed;
|
||||||
if (calculateProgressEnabled) {
|
if (calculateProgressEnabled) {
|
||||||
final int percent = downloaded * 100 / contentLength;
|
final int percent = (int) (downloaded / ((double) contentLength) * 100.0);
|
||||||
progressCallback.execute(
|
progressCallback.execute(
|
||||||
NumberValue.of(percent),
|
NumberValue.of(percent),
|
||||||
NumberValue.of(downloaded),
|
NumberValue.of(downloaded),
|
||||||
|
Loading…
Reference in New Issue
Block a user