Package org.openstreetmap.josm.io
Class ProgressInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.openstreetmap.josm.io.ProgressInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ProgressInputStream extends java.io.InputStream
Read from an other reader and increment an progress counter while on the way.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.InputStream
in
private StreamProgressUpdater
updater
-
Constructor Summary
Constructors Constructor Description ProgressInputStream(java.io.InputStream in, long size, ProgressMonitor progressMonitor)
Constructs a newProgressInputStream
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
read()
int
read(byte[] b, int off, int len)
-
-
-
Field Detail
-
updater
private final StreamProgressUpdater updater
-
in
private final java.io.InputStream in
-
-
Constructor Detail
-
ProgressInputStream
public ProgressInputStream(java.io.InputStream in, long size, ProgressMonitor progressMonitor)
Constructs a newProgressInputStream
.- Parameters:
in
- the stream to monitor. Must not be nullsize
- the total size which will be sentprogressMonitor
- the monitor to report to- Since:
- 9172
-
-
Method Detail
-
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.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-