Package com.helger.commons.io.stream
Class CountingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.helger.commons.io.stream.WrappedInputStream
com.helger.commons.io.stream.CountingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
A wrapper around an
InputStream that counts the number of read bytes.- Author:
- Philip Helger
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.helger.commons.io.stream.WrappedInputStream
getWrappedInputStreamMethods inherited from class java.io.FilterInputStream
available, close, markSupported, readMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CountingInputStream
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
mark
- Overrides:
markin classFilterInputStream
-
reset
- Overrides:
resetin classFilterInputStream- Throws:
IOException
-
getBytesRead
- Returns:
- The number of read bytes.
-
getPosition
- Returns:
- The current position in the input stream (taking skip and mark/reset into account)
-
getMark
- Returns:
- The current mark
- Since:
- 9.3.8
-
toString
- Overrides:
toStringin classWrappedInputStream
-