Package binaryFileStorage
Class CountingInputStream
java.lang.Object
java.io.InputStream
binaryFileStorage.CountingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Wrapper class for an input stream which counts the number of bytes
read, skipped etc. so that a getPos() function can be used to check
the total number of bytes now read.
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CountingInputStream
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
mark
public void mark(int arg0) - Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
getPos
public long getPos()- Returns:
- the pos
-