Package com.aoindustries.io
Class ByteCountInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.aoindustries.io.ByteCountInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ByteCountInputStream extends FilterInputStream
Wraps an InputStream to count the number of bytes transferred. The counter is not synchronized. Any necessary synchronization should be externally applied.- Author:
- AO Industries, Inc.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description ByteCountInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCount()intread()intread(byte[] b)intread(byte[] b, int off, int len)-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
-
-
-
-
Constructor Detail
-
ByteCountInputStream
public ByteCountInputStream(InputStream in)
-
-
Method Detail
-
read
public int read() throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classFilterInputStream- Throws:
IOException
-
getCount
public long getCount()
-
-