com.amazonaws.util
Class CountingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.amazonaws.internal.SdkFilterInputStream
              extended by com.amazonaws.util.CountingInputStream
All Implemented Interfaces:
com.amazonaws.internal.MetricAware, Closeable

public class CountingInputStream
extends com.amazonaws.internal.SdkFilterInputStream

Simple input stream wrapper utility to count the bytes read from a stream.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
CountingInputStream(InputStream in)
           
 
Method Summary
 long getByteCount()
          Returns the number of bytes read from this stream so far.
 int read()
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class com.amazonaws.internal.SdkFilterInputStream
abort, abortIfNeeded, available, close, isMetricActivated, mark, markSupported, reset, skip
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
read in class com.amazonaws.internal.SdkFilterInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class com.amazonaws.internal.SdkFilterInputStream
Throws:
IOException


Copyright © 2016. All rights reserved.