org.eclipse.paho.client.mqttv3.internal.wire
Class CountingInputStream
java.lang.Object
java.io.InputStream
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.
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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CountingInputStream
public CountingInputStream(InputStream in)
- Constructs a new
CountingInputStream
wrapping the supplied
input stream.
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.