- 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 voidclose()ProgressiongetProgression()Replies the progression model used by this input stream.intread()intread(byte[] buffer)intread(byte[] buffer, int off, int len)voidreset()longskip(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:
readin classFilterInputStream- Throws:
IOException
-
read
public int read(byte[] buffer) throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
public int read(byte[] buffer, int off, int len) throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
public long skip(long number) throws IOException- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classFilterInputStream- Throws:
IOException
-
-