Class CountInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
uk.ac.starlink.util.CountInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
Filter input stream that counts the number of bytes read.
- Since:
- 9 May 2014
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class FilterInputStream
available, close, mark, markSupported, resetMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CountInputStream
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
getReadCount
public long getReadCount()Returns the number of bytes successfully read so far from this stream.- Returns:
- number of bytes read
-
getSkipCount
public long getSkipCount()Returns the number of bytes skipped from this stream.- Returns:
- number of bytes skipped
-