mirror of
https://github.com/Steffo99/unimore-oop-2020-cleaver.git
synced 2024-11-21 23:54:20 +00:00
Fix critical bug
This commit is contained in:
parent
592e631b9c
commit
263a51f70c
1 changed files with 3 additions and 2 deletions
|
@ -178,9 +178,10 @@ public class StitchJob extends Job {
|
|||
|
||||
byte[] buffer = new byte[BUFFER_SIZE];
|
||||
int readBytes = inputStream.read(buffer);
|
||||
while(inputStream.read(buffer) != -1) {
|
||||
while(readBytes != -1) {
|
||||
outputStream.write(buffer, 0, readBytes);
|
||||
this.setProgress(new WorkingProgress((float)(resultFile.length() - inputStream.available()) / (float)resultFile.length()));
|
||||
long targetSize = resultFile.length() + inputStream.available();
|
||||
this.setProgress(new WorkingProgress((float)(resultFile.length()) / (float)targetSize));
|
||||
readBytes = inputStream.read(buffer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue