Package i2p.susi.util
Class CountingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- i2p.susi.util.CountingInputStream
-
- All Implemented Interfaces:
ReadCounter
,Closeable
,AutoCloseable
- Direct Known Subclasses:
LimitInputStream
public class CountingInputStream extends FilterInputStream implements ReadCounter
An InputStream that implements ReadCounter.- Since:
- 0.9.34
-
-
Field Summary
Fields Modifier and Type Field Description protected long
count
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description CountingInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getRead()
The total number of bytes that have been read or skippedint
read()
int
read(byte[] buf, int off, int len)
long
skip(long n)
-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
CountingInputStream
public CountingInputStream(InputStream in)
-
-
Method Detail
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
getRead
public long getRead()
Description copied from interface:ReadCounter
The total number of bytes that have been read or skipped- Specified by:
getRead
in interfaceReadCounter
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
-