org.apache.commons.io.input
Class CountingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.ProxyInputStream
org.apache.commons.io.input.CountingInputStream
- public class CountingInputStream
- extends ProxyInputStream
Used in debugging, it counts the number of bytes that pass
through it.
- Version:
- $Id: CountingInputStream.java,v 1.6 2003/12/30 15:19:00 jeremias Exp $
- Author:
- Henri Yandell
Field Summary |
private int |
count
|
Fields inherited from class java.io.FilterInputStream |
in |
Fields inherited from class java.io.InputStream |
|
Constructor Summary |
CountingInputStream(java.io.InputStream in)
Constructs a new CountingInputStream. |
Method Summary |
int |
getCount()
The number of bytes that have passed through this stream. |
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
count
private int count
CountingInputStream
public CountingInputStream(java.io.InputStream in)
- Constructs a new CountingInputStream.
- Parameters:
in
- InputStream to delegate to
read
public int read(byte[] b)
throws java.io.IOException
- Overrides:
read
in class ProxyInputStream
- Throws:
java.io.IOException
- See Also:
InputStream.read(byte[])
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read
in class ProxyInputStream
- Throws:
java.io.IOException
- See Also:
InputStream.read(byte[], int, int)
read
public int read()
throws java.io.IOException
- Overrides:
read
in class ProxyInputStream
- Throws:
java.io.IOException
- See Also:
InputStream.read()
getCount
public int getCount()
- The number of bytes that have passed through this stream.
- Returns:
- the number of bytes accumulated