Closeable, AutoCloseable, InputStreamWrapperpublic class ProgressMonitoredInputStream extends InputStream implements InputStreamWrapper
BytesProgressWatcher object is notified of the count of bytes read.| Constructor | Description |
|---|---|
ProgressMonitoredInputStream(InputStream inputStream,
BytesProgressWatcher progressWatcher) |
Construts the input stream around an underlying stream and sends notification messages
to a progress watcher when bytes are read from the stream.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
|
void |
close() |
|
InputStream |
getWrappedInputStream() |
|
int |
read() |
|
int |
read(byte[] b) |
|
int |
read(byte[] b,
int off,
int len) |
|
void |
resetProgressMonitor() |
|
void |
sendNotificationUpdate(long bytesTransmitted) |
Checks how many bytes have been transferred since the last notification, and sends a notification
message if this number exceeds the minimum bytes transferred value.
|
mark, markSupported, readAllBytes, readNBytes, reset, skip, transferTopublic ProgressMonitoredInputStream(InputStream inputStream, BytesProgressWatcher progressWatcher)
inputStream - the input stream to wrap, whose byte transfer count will be monitored.progressWatcher - a watcher object that stores information about the bytes read from a stream, and
allows calculations to be perfomed using this information.public void sendNotificationUpdate(long bytesTransmitted)
bytesTransmitted - public void resetProgressMonitor()
public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface AutoCloseableclose in interface Closeableclose in class InputStreamIOExceptionpublic InputStream getWrappedInputStream()
getWrappedInputStream in interface InputStreamWrapper