org.eclipse.paho.client.mqttv3.internal.wire
Class CountingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.eclipse.paho.client.mqttv3.internal.wire.CountingInputStream
All Implemented Interfaces:
Closeable

public class CountingInputStream
extends InputStream

An input stream that counts the bytes read from it.


Constructor Summary
CountingInputStream(InputStream in)
          Constructs a new CountingInputStream wrapping the supplied input stream.
 
Method Summary
 int getCounter()
          Returns the number of bytes read since the last reset.
 int read()
           
 void resetCounter()
          Resets the counter to zero.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
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)
Constructs a new CountingInputStream wrapping the supplied input stream.

Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

getCounter

public int getCounter()
Returns the number of bytes read since the last reset.


resetCounter

public void resetCounter()
Resets the counter to zero.



Copyright © 2013. All Rights Reserved.