|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.antelmann.io.MonitorInputStream
public class MonitorInputStream
this class is essentially a re-implementation of a ProgressMonitorInputStream, but with a com.antelmann.util.Monitor instead.
| Field Summary |
|---|
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
MonitorInputStream(InputStream in)
|
|
MonitorInputStream(InputStream in,
Monitor monitor)
Constructs an object to monitor the progress of an input stream. |
|
MonitorInputStream(InputStream in,
Monitor monitor,
boolean maintainSizeAutomatically)
|
|
| Method Summary | |
|---|---|
void |
close()
Overrides FilterInputStream.close
to close the monitor as well as the stream. |
Monitor |
getProgressMonitor()
|
protected void |
initSize()
|
int |
read()
Overrides FilterInputStream.read
to update the monitor after the read. |
int |
read(byte[] b)
Overrides FilterInputStream.read
to update the monitor after the read. |
int |
read(byte[] b,
int off,
int len)
Overrides FilterInputStream.read
to update the monitor after the read. |
void |
reset()
Overrides FilterInputStream.reset
to reset the monitor as well as the stream. |
long |
skip(long n)
Overrides FilterInputStream.skip
to update the monitor after the skip. |
protected void |
updateMonitor(long bytesRead)
|
| Methods inherited from class java.io.FilterInputStream |
|---|
available, mark, markSupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MonitorInputStream(InputStream in)
public MonitorInputStream(InputStream in,
Monitor monitor)
in - The input stream to be monitored.
public MonitorInputStream(InputStream in,
Monitor monitor,
boolean maintainSizeAutomatically)
| Method Detail |
|---|
public Monitor getProgressMonitor()
protected void initSize()
protected void updateMonitor(long bytesRead)
throws IOException
IOException
public int read()
throws IOException
FilterInputStream.read
to update the monitor after the read.
read in class FilterInputStreamIOException
public int read(byte[] b)
throws IOException
FilterInputStream.read
to update the monitor after the read.
read in class FilterInputStreamIOException
public int read(byte[] b,
int off,
int len)
throws IOException
FilterInputStream.read
to update the monitor after the read.
read in class FilterInputStreamIOException
public long skip(long n)
throws IOException
FilterInputStream.skip
to update the monitor after the skip.
skip in class FilterInputStreamIOException
public void close()
throws IOException
FilterInputStream.close
to close the monitor as well as the stream.
close in interface Closeableclose in class FilterInputStreamIOException
public void reset()
throws IOException
FilterInputStream.reset
to reset the monitor as well as the stream.
reset in class FilterInputStreamIOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||