com.bigdata.io
Class ByteCountInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by 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

Constructor Summary
ByteCountInputStream(InputStream in)
           
 
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.io.FilterInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteCountInputStream

public ByteCountInputStream(InputStream in)
Parameters:
in -
Method Detail

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.