- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.arakhne.afc.progress.ProgressionInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ProgressionInputStream extends FilterInputStream
InputStream that is able to notify about the reading progression.- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- util
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description ProgressionInputStream(InputStream in, int totalSize, Progression progression)
Constructor.ProgressionInputStream(InputStream in, Progression progression)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Progression
getProgression()
Replies the progression model used by this input stream.int
read()
int
read(byte[] buffer)
int
read(byte[] buffer, int off, int len)
void
reset()
long
skip(long number)
-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ProgressionInputStream
public ProgressionInputStream(InputStream in, Progression progression)
Constructor.- Parameters:
in
- is the input to readprogression
- is the progression model used to notify on the reading progression.
-
ProgressionInputStream
public ProgressionInputStream(InputStream in, int totalSize, Progression progression)
Constructor.- Parameters:
in
- is the input to readtotalSize
- is the total number of bytes to read from the stream.progression
- is the progression model used to notify on the reading progression.
-
-
Method Detail
-
getProgression
public Progression getProgression()
Replies the progression model used by this input stream.- Returns:
- the progression model.
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
public long skip(long number) throws IOException
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
reset
public void reset() throws IOException
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
-