Package com.amazonaws.util
Class CountingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.amazonaws.internal.SdkFilterInputStream
-
- com.amazonaws.util.CountingInputStream
-
- All Implemented Interfaces:
com.amazonaws.internal.MetricAware,com.amazonaws.internal.Releasable,Closeable,AutoCloseable
public class CountingInputStream extends com.amazonaws.internal.SdkFilterInputStreamSimple input stream wrapper utility to count the bytes read from a stream.
-
-
Field Summary
-
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 longgetByteCount()Returns the number of bytes read from this stream so far.intread()intread(byte[] b, int off, int len)-
Methods inherited from class com.amazonaws.internal.SdkFilterInputStream
abort, abortIfNeeded, available, close, isMetricActivated, mark, markSupported, release, reset, skip
-
Methods inherited from class java.io.FilterInputStream
read
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
CountingInputStream
public CountingInputStream(InputStream in)
-
-
Method Detail
-
getByteCount
public long getByteCount()
Returns the number of bytes read from this stream so far.- Returns:
- the number of bytes read from this stream so far.
-
read
public int read() throws IOException- Overrides:
readin classcom.amazonaws.internal.SdkFilterInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classcom.amazonaws.internal.SdkFilterInputStream- Throws:
IOException
-
-