Class CountingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.google.common.io.CountingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
An
InputStream
that counts the number of bytes read.- Since:
- 1.0
- Author:
- Chris Nokleberg
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorDescriptionWraps another input stream, counting the number of bytes read. -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, markSupported, read
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CountingInputStream
Wraps another input stream, counting the number of bytes read.- Parameters:
in
- the input stream to be wrapped
-
-
Method Details
-
getCount
Returns the number of bytes read. -
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
mark
- Overrides:
mark
in classFilterInputStream
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-