BAEL-4856 Rename ProgressCallable to ProgressCallback

This commit is contained in:
Iulian Manda 2021-06-05 15:49:46 +03:00
parent 34c9e82eee
commit 081abb8dd7
2 changed files with 5 additions and 5 deletions

View File

@ -9,11 +9,11 @@ public class BinaryFileWriter implements AutoCloseable {
private static final int CHUNK_SIZE = 1024; private static final int CHUNK_SIZE = 1024;
private final OutputStream outputStream; private final OutputStream outputStream;
private final ProgressCallable progressCallable; private final ProgressCallback progressCallback;
public BinaryFileWriter(OutputStream outputStream, ProgressCallable progressCallable) { public BinaryFileWriter(OutputStream outputStream, ProgressCallback progressCallback) {
this.outputStream = outputStream; this.outputStream = outputStream;
this.progressCallable = progressCallable; this.progressCallback = progressCallback;
} }
public long write(InputStream inputStream, double length) throws IOException { public long write(InputStream inputStream, double length) throws IOException {
@ -24,7 +24,7 @@ public class BinaryFileWriter implements AutoCloseable {
while ((readBytes = input.read(dataBuffer)) != -1) { while ((readBytes = input.read(dataBuffer)) != -1) {
totalBytes += readBytes; totalBytes += readBytes;
outputStream.write(dataBuffer, 0, readBytes); outputStream.write(dataBuffer, 0, readBytes);
progressCallable.onProgress(totalBytes / length * 100.0); progressCallback.onProgress(totalBytes / length * 100.0);
} }
return totalBytes; return totalBytes;
} }

View File

@ -1,6 +1,6 @@
package com.baeldung.okhttp.download; package com.baeldung.okhttp.download;
public interface ProgressCallable { public interface ProgressCallback {
void onProgress(double progress); void onProgress(double progress);