com.bigdata.io
Class ByteCountInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.bigdata.io.ByteCountInputStream
- All Implemented Interfaces:
- Closeable
public class ByteCountInputStream
- extends FilterInputStream
Input stream which reports the #of bytes read from the underlying stream.
Note: All read methods MUST be overridden if you subclass this
filter as it overrides them all for better performance.
- Version:
- $Id: ByteCountInputStream.java 4582 2011-05-31 19:12:53Z thompsonbry $
TODO test suite.
- Author:
- Bryan Thompson
|
Method Summary |
int |
getNRead()
The #of bytes read from the underlying stream. |
int |
read()
|
int |
read(byte[] a)
|
int |
read(byte[] a,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteCountInputStream
public ByteCountInputStream(InputStream in)
- Parameters:
in -
getNRead
public int getNRead()
- The #of bytes read from the underlying stream.
read
public int read()
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] a)
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] a,
int off,
int len)
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.