Package moa.core
Class InputStreamProgressMonitor
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- moa.core.InputStreamProgressMonitor
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class InputStreamProgressMonitor extends FilterInputStream
Class for monitoring the progress of reading an input stream.- Version:
- $Revision: 7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected int
inputByteSize
The number of bytes to read in totalprotected int
inputBytesRead
The number of bytes read so far-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description InputStreamProgressMonitor(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBytesRead()
int
getBytesRemaining()
double
getProgressFraction()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
long
skip(long n)
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
InputStreamProgressMonitor
public InputStreamProgressMonitor(InputStream in)
-
-
Method Detail
-
getBytesRead
public int getBytesRead()
-
getBytesRemaining
public int getBytesRemaining()
-
getProgressFraction
public double getProgressFraction()
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
-