Package com.helger.io.stream
Class CountingFileInputStream
java.lang.Object
java.io.InputStream
java.io.FileInputStream
com.helger.io.stream.CountingFileInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
A special
FileInputStream sub class that keeps track of all read
bytes for the statistics handler.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionCountingFileInputStream(@NonNull File aFile) Create a counting file input stream for the passed file.CountingFileInputStream(@NonNull String sFilename) Create a counting file input stream for the passed filename. -
Method Summary
Methods inherited from class java.io.FileInputStream
available, close, getChannel, getFD, readAllBytes, readNBytes, skip, transferToMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readNBytes, reset, skipNBytes
-
Constructor Details
-
CountingFileInputStream
Create a counting file input stream for the passed file.- Parameters:
aFile- The file to read from. May not benull.- Throws:
FileNotFoundException- If the file does not exist.
-
CountingFileInputStream
Create a counting file input stream for the passed filename.- Parameters:
sFilename- The name of the file to read from. May not benull.- Throws:
FileNotFoundException- If the file does not exist.
-
-
Method Details
-
read
- Overrides:
readin classFileInputStream- Throws:
IOException
-
read
- Overrides:
readin classFileInputStream- Throws:
IOException
-
read
- Overrides:
readin classFileInputStream- Throws:
IOException
-