public class ProgressMonitorInputStream extends FilterInputStream
ProgressMonitor.in| Constructor and Description |
|---|
ProgressMonitorInputStream(Component component,
Object message,
InputStream stream)
Creates a new
ProgressMonitorInputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the input stream and the associated
ProgressMonitor. |
ProgressMonitor |
getProgressMonitor()
Returns the
ProgressMonitor used by this input stream. |
int |
read()
Reads an unsigned byte from the input stream and returns it as an
int in the range of 0-255. |
int |
read(byte[] data)
Reads bytes from the input stream and stores them in the supplied array,
and updates the progress monitor (or closes it if the end of the stream
is reached).
|
int |
read(byte[] data,
int offset,
int length)
Reads up to
length bytes from the input stream and stores
them in the supplied array at the given index, and updates the progress
monitor (or closes it if the end of the stream is reached). |
void |
reset()
Resets the input stream to the point where
FilterInputStream.mark(int) was called. |
long |
skip(long length)
Skips the specified number of bytes and updates the
ProgressMonitor. |
available, mark, markSupportedpublic ProgressMonitorInputStream(Component component, Object message, InputStream stream)
ProgressMonitorInputStream.component - the parent component for the progress monitor dialog.message - the task description.stream - the underlying input stream.public void reset() throws IOException
FilterInputStream.mark(int) was called.reset in class FilterInputStreamIOException - TODOpublic int read() throws IOException
int in the range of 0-255. Returns -1 if the end of the
stream has been reached. The progress monitor is updated.read in class FilterInputStreamIOException - if there is a problem reading the stream.public int read(byte[] data) throws IOException
read in class FilterInputStreamdata - the data array for returning bytes read from the stream.IOException - if there is a problem reading bytes from the stream.public int read(byte[] data, int offset, int length) throws IOException
length bytes from the input stream and stores
them in the supplied array at the given index, and updates the progress
monitor (or closes it if the end of the stream is reached).read in class FilterInputStreamdata - the data array for returning bytes read from the stream.offset - the offset into the array where the bytes should be written.length - the maximum number of bytes to read from the stream.IOException - if there is a problem reading bytes from the stream.public long skip(long length) throws IOException
ProgressMonitor.skip in class FilterInputStreamlength - the number of bytes to skip.IOException - if there is a problem skipping bytes in the stream.public void close() throws IOException
ProgressMonitor.close in interface Closeableclose in interface AutoCloseableclose in class FilterInputStreamIOException - if there is a problem closing the input stream.public ProgressMonitor getProgressMonitor()
ProgressMonitor used by this input stream.