com.partnersoft.io
Class CountingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.partnersoft.io.CountingOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
UploadReportingOutputStream

public class CountingOutputStream
extends java.io.FilterOutputStream

An output stream that counts off bytecount of all reads.

Author:
Paul Reavis Copyright 2000 Partner Software, Inc.

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
CountingOutputStream(java.io.OutputStream out)
           
 
Method Summary
 void bytesWereWritten(int byteCount)
          Override this to be notified of each batch of data.
 long getByteCount()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int byteMe)
           
 
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

CountingOutputStream

public CountingOutputStream(java.io.OutputStream out)
Method Detail

write

public void write(int byteMe)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

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

write

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

bytesWereWritten

public void bytesWereWritten(int byteCount)
Override this to be notified of each batch of data.


getByteCount

public long getByteCount()