public class ProgressInputStream extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
private java.io.InputStream |
in |
private StreamProgressUpdater |
updater |
Constructor and Description |
---|
ProgressInputStream(java.io.InputStream in,
long size,
ProgressMonitor progressMonitor)
Constructs a new
ProgressInputStream . |
ProgressInputStream(java.net.URLConnection con,
ProgressMonitor progressMonitor)
Constructs a new
ProgressInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
private final StreamProgressUpdater updater
private final java.io.InputStream in
public ProgressInputStream(java.io.InputStream in, long size, ProgressMonitor progressMonitor)
ProgressInputStream
.in
- the stream to monitor. Must not be nullsize
- the total size which will be sentprogressMonitor
- the monitor to report topublic ProgressInputStream(java.net.URLConnection con, ProgressMonitor progressMonitor) throws OsmTransferException
ProgressInputStream
.
Will call URLConnection.getInputStream()
to obtain the stream to monitor.con
- the connection to monitorprogressMonitor
- the monitor to report toOsmTransferException
- if any I/O error occurspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException