public class FileProgressInputStream
extends java.io.FilterInputStream
| Constructor and Description |
|---|
FileProgressInputStream(javax.swing.JProgressBar fileProgressBar,
java.io.InputStream inputStream,
java.lang.String filename,
long length)
Constructs an object to monitor the progress of an input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Overrides
FilterInputStream.close to close the progress monitor
as well as the stream. |
FileProgressMonitor |
getProgressMonitor()
Get the ProgressMonitor object being used by this stream.
|
int |
read()
Overrides
FilterInputStream.read to update the progress monitor
after the read. |
int |
read(byte[] b)
Overrides
FilterInputStream.read to update the progress monitor
after the read. |
int |
read(byte[] b,
int off,
int len)
Overrides
FilterInputStream.read to update the progress monitor
after the read. |
void |
reset()
Overrides
FilterInputStream.reset to reset the progress monitor
as well as the stream. |
long |
skip(long n)
Overrides
FilterInputStream.skip to update the progress monitor
after the skip. |
public FileProgressInputStream(javax.swing.JProgressBar fileProgressBar,
java.io.InputStream inputStream,
java.lang.String filename,
long length)
inputStream - The input stream to be monitored.fileProgressBar - the corresponding JProgressBarfilename - the name of the file to streamlength - the file lengthpublic FileProgressMonitor getProgressMonitor()
public int read()
throws java.io.IOException
FilterInputStream.read to update the progress monitor
after the read.read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
FilterInputStream.read to update the progress monitor
after the read.read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
FilterInputStream.read to update the progress monitor
after the read.read in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
FilterInputStream.skip to update the progress monitor
after the skip.skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
FilterInputStream.close to close the progress monitor
as well as the stream.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterInputStreamjava.io.IOExceptionpublic void reset()
throws java.io.IOException
FilterInputStream.reset to reset the progress monitor
as well as the stream.reset in class java.io.FilterInputStreamjava.io.IOException