public class ProgressInputStream extends InputStreamTracker
progressReport(String)
method should be overridden.Modifier and Type | Field and Description |
---|---|
protected long |
interval |
protected long |
nextProgress |
protected AbsoluteProgressReporter |
progress |
Constructor and Description |
---|
ProgressInputStream(InputStream in,
AbsoluteProgressReporter progress)
Create a new input stream using the default 1MB interval.
|
ProgressInputStream(InputStream in,
AbsoluteProgressReporter progress,
long interval)
Create a new input stream using the specified interval.
|
Modifier and Type | Method and Description |
---|---|
protected void |
progressReport(String message)
Send a progress report with the given message.
|
int |
read(byte[] b,
int off,
int len) |
available, close, getNumRead, mark, markSupported, read, read, reset, skip
protected final AbsoluteProgressReporter progress
protected final long interval
protected long nextProgress
public ProgressInputStream(InputStream in, AbsoluteProgressReporter progress)
public ProgressInputStream(InputStream in, AbsoluteProgressReporter progress, long interval)
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStreamTracker
IOException
protected void progressReport(String message)
Values.formatBytes(Long, int)
). Subclasses may override this
method to generate a different message.message
-