org.apache.commons.io.input
Class CountingInputStream
public class CountingInputStream
Used in debugging, it counts the number of bytes that pass
through it.
$Id: CountingInputStream.java,v 1.8 2004/02/23 04:38:52 bayard Exp $
int | getCount() - The number of bytes that have passed through this stream.
|
int | read() - Increases the count by 1.
|
int | read(byte[] b) - Increases the count by super.read(b)'s return count
|
int | read(byte[] b, int off, int len) - Increases the count by super.read(b, off, len)'s return count
|
CountingInputStream
public CountingInputStream(InputStream in)
Constructs a new CountingInputStream.
in
- InputStream to delegate to
getCount
public int getCount()
The number of bytes that have passed through this stream.
- the number of bytes accumulated
read
public int read()
throws IOException
Increases the count by 1.
- read in interface ProxyInputStream
java.io.InputStream.read()
read
public int read(byte[] b)
throws IOException
Increases the count by super.read(b)'s return count
- read in interface ProxyInputStream
java.io.InputStream.read(byte[])
read
public int read(byte[] b,
int off,
int len)
throws IOException
Increases the count by super.read(b, off, len)'s return count
- read in interface ProxyInputStream
java.io.InputStream.read(byte[], int, int)