Package overit.geocall.util
Class InputStreamCounter
java.lang.Object
java.io.InputStream
overit.geocall.util.InputStreamCounter
- All Implemented Interfaces:
Closeable,AutoCloseable
Class that extends
InputStream that adds the ability to know the number
of bytes read.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of InputStreamCounter -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
_n
protected int _n -
_is
-
-
Constructor Details
-
InputStreamCounter
Creates an instance of InputStreamCounter- Parameters:
is- TheInputStream
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
getCount
public int getCount()Return the number of bytes read.- Returns:
- The number of bytes read.
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-