- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- util.ui.progress.ProgressInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ProgressInputStream extends java.io.FilterInputStream
This inputstream can display the current position of a file using a ProgressMonitor.- Since:
- 2.7
-
-
Constructor Summary
Constructors Constructor Description ProgressInputStream(java.io.InputStream in, ProgressMonitor monitor)
Creates the StreamProgressInputStream(java.io.InputStream in, ProgressMonitor monitor, int position)
Creates the Stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
getCurrentPosition()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
long
skip(long n)
-
-
-
Constructor Detail
-
ProgressInputStream
public ProgressInputStream(java.io.InputStream in, ProgressMonitor monitor)
Creates the Stream- Parameters:
in
- the underlying input streammonitor
- display the progress in this monitor
-
ProgressInputStream
public ProgressInputStream(java.io.InputStream in, ProgressMonitor monitor, int position)
Creates the Stream- Parameters:
in
- the underlying input streammonitor
- display the progress in this monitorposition
- start at this position
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
getCurrentPosition
public int getCurrentPosition()
-
-