Class CountingInputStream

  • All Implemented Interfaces:
    com.amazonaws.internal.MetricAware, com.amazonaws.internal.Releasable, Closeable, AutoCloseable

    public class CountingInputStream
    extends com.amazonaws.internal.SdkFilterInputStream
    Simple input stream wrapper utility to count the bytes read from a stream.
    • 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