com.bigdata.io
Class ByteCountOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.bigdata.io.ByteCountOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class ByteCountOutputStream
extends FilterOutputStream

Output stream which reports the #of bytes read from the underlying stream.

Note: All write methods MUST be overridden if you subclass this filter as it overrides them all for better performance.

Version:
$Id: ByteCountOutputStream.java 4582 2011-05-31 19:12:53Z thompsonbry $ TODO test suite.
Author:
Bryan Thompson

Constructor Summary
ByteCountOutputStream(OutputStream out)
           
 
Method Summary
 int getNWritten()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteCountOutputStream

public ByteCountOutputStream(OutputStream out)
Parameters:
out -
Method Detail

getNWritten

public int getNWritten()

write

public void write(int b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.