de.unkrig.commons.io
Class CountingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.unkrig.commons.io.CountingOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class CountingOutputStream
extends java.io.OutputStream

An OutputStream that counts the number of bytes written to it.


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

Constructor Detail

CountingOutputStream

public CountingOutputStream()

CountingOutputStream

public CountingOutputStream(long initialCount)
Method Detail

write

public void write(int b)
Specified by:
write in class java.io.OutputStream

write

public void write(byte[] b,
                  int off,
                  int len)
Overrides:
write in class java.io.OutputStream

getCount

public long getCount()
Returns:
The current count