Closed
Description
Hi there!
A very nice tool!
Could you please add also support for output streams?
For instance the library I am using for datalake is providing only output stream, so what I did is this:
ProgressBar pb = new ProgressBarBuilder()
.setTaskName("Downloading "+pathItem.getName())
.setUnit("MiB", 1024*1024)
.build();
pb.maxHint(pathItem.getContentLength());
OutputStream targetStream = new FileOutputStream(outputFile) {
@Override
public void write(byte[] b) throws IOException {
super.write(b);
pb.stepBy(b.length);
}
@Override
public void write(int b) throws IOException {
super.write(b);
pb.step();
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
super.write(b, off, len);
pb.stepBy(b.length);
}
};
I guess that anonym class should be part of this project somehow.
Cheers,
Andrej
Activity