org.openstreetmap.josm.io
Class ProgressInputStream
java.lang.Object
java.io.InputStream
org.openstreetmap.josm.io.ProgressInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class ProgressInputStream
- extends java.io.InputStream
Read from an other reader and increment an progress counter while on the way.
Method Summary |
private void |
advanceTicker(int amount)
Increase ticker (progress counter and displayed text) by the given amount. |
void |
close()
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
private void |
updateSize()
|
Methods inherited from class java.io.InputStream |
available, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
private final java.io.InputStream in
readSoFar
private int readSoFar
lastDialogUpdate
private int lastDialogUpdate
sizeKnown
private boolean sizeKnown
connection
private final java.net.URLConnection connection
progressMonitor
private final ProgressMonitor progressMonitor
ProgressInputStream
public ProgressInputStream(java.net.URLConnection con,
ProgressMonitor progressMonitor)
throws OsmTransferException
- Throws:
OsmTransferException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read()
throws java.io.IOException
- Specified by:
read
in class java.io.InputStream
- Throws:
java.io.IOException
advanceTicker
private void advanceTicker(int amount)
- Increase ticker (progress counter and displayed text) by the given amount.
- Parameters:
amount
-
updateSize
private void updateSize()
JOSM