org.apache.lucene.util
Class CountedInputStream
Object
InputStream
FilterInputStream
CountedInputStream
- All Implemented Interfaces:
- Closeable
public class CountedInputStream
- extends FilterInputStream
Wraps an InputStream, and counts how many bytes have been read from it.
- Author:
- Martin Haye
Field Summary |
private long |
nRead
Count of the number of bytes read from the stream so far |
Fields inherited from class FilterInputStream |
in |
Method Summary |
boolean |
markSupported()
|
long |
nRead()
Find out how many bytes have been read so far |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
long |
skip(long n)
|
Methods inherited from class FilterInputStream |
available, close, mark, read, reset |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nRead
private long nRead
- Count of the number of bytes read from the stream so far
CountedInputStream
public CountedInputStream(InputStream in)
- Wrap an input stream
nRead
public long nRead()
- Find out how many bytes have been read so far
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip
in class FilterInputStream
- Throws:
IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported
in class FilterInputStream