Class CountingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
de.tomatengames.util.io.CountingInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
A
FilterInputStream that counts the bytes read from it.- Since:
- 1.2
-
Field Summary
Fields inherited from class FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class FilterInputStream
available, close, markSupportedMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CountingInputStream
Creates a newCountingInputStream.- Parameters:
in- The underlyingInputStream.
-
-
Method Details
-
getByteCount
public long getByteCount()Returns the number of read bytes.- Returns:
- The number of read bytes.
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
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
-