while ((read = bis.read(buf)) != -1) {
bos.write(buf, 0, read);
readCount = readCount + read;
if (readCount > length) length = readCount;
progress.progress(progressLabel, (int) (readCount * READ_COUNT_MULTIPLIER / length));
}
progress.info(progressLabel, "downloaded with " + downloadSpeed(downloadStartedAt,length));
} finally {
downloadStream.close();
bos.flush();