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
ConstructorsConstructorDescriptionWraps another input stream, counting the number of bytes read. -
Method Summary
Methods 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
Wraps another input stream, counting the number of bytes read.- Parameters:
in- the input stream to be wrapped
-
-
Method Details
-
getCount
public long getCount()Returns the number of bytes read. -
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classFilterInputStream
-
reset
- Overrides:
resetin classFilterInputStream- Throws:
IOException
-