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(java.io.InputStream in,
AbsoluteProgressReporter progress)
Create a new input stream using the default 1MB interval.
|
ProgressInputStream(java.io.InputStream in,
AbsoluteProgressReporter progress,
long interval)
Create a new input stream using the specified interval.
|
Modifier and Type | Method and Description |
---|---|
protected void |
progressReport(java.lang.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(java.io.InputStream in, AbsoluteProgressReporter progress)
public ProgressInputStream(java.io.InputStream in, AbsoluteProgressReporter progress, long interval)
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class InputStreamTracker
java.io.IOException
protected void progressReport(java.lang.String message)
Values.formatBytes(Long, int)
). Subclasses may override this
method to generate a different message.