public class ProgressInputStream
extends java.io.InputStream
InputStream that can report the progress of reading from another InputStream to a
ProgressListener.| Constructor and Description |
|---|
ProgressInputStream(java.io.InputStream stream,
ProgressListener listener,
long total)
Constructs a ProgressInputStream that wraps another InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getTotal()
Gets the total number of bytes that are expected to be read from the stream.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
setTotal(long total)
Sets the total number of bytes that are expected to be read from the stream.
|
public ProgressInputStream(java.io.InputStream stream,
ProgressListener listener,
long total)
stream - the stream whose progress will be monitored.listener - the listener that will receive progress updates.total - the total number of bytes that are expected to be read from the stream.public long getTotal()
public void setTotal(long total)
total - the total number of bytespublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException