com.tffenterprises.io
Class AccountingOutputStream

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

public class AccountingOutputStream
extends java.io.FilterOutputStream

AccountingOutputStream is a FilterOutputStream that implements the AccountingOutput interface.

Version:
1.0d1 $Date: 2000/06/20 02:52:25 $
Author:
Guillaume Lessard

Field Summary
private  long written
          Our register of written bytes.
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
AccountingOutputStream(java.io.OutputStream out)
          Constructor, the standard for a FilterOutputStream subclass...
 
Method Summary
 void write(byte[] b, int off, int len)
          Writes len bytes from the specified byte array starting at offset off to this output stream.
 void write(int b)
          Writes the specified byte to this output stream.
 long written()
          Returns the number of bytes that have been written to the stream or file since the AccountingOutput instance was constructed.
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

written

private long written
Our register of written bytes.

Constructor Detail

AccountingOutputStream

public AccountingOutputStream(java.io.OutputStream out)
Constructor, the standard for a FilterOutputStream subclass...

Parameters:
out - the OutputStream to encapsulate
Method Detail

written

public long written()
Returns the number of bytes that have been written to the stream or file since the AccountingOutput instance was constructed.

Returns:
the number of bytes that have been written out.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes len bytes from the specified byte array starting at offset off to this output stream.

Overrides:
write in class java.io.FilterOutputStream
Parameters:
b - the byte array from which to copy bytes to the stream.
off - the offset at which to start reading bytes from b.
len - the number of bytes to read from b
Throws:
java.io.IOException - if the underlying stream throws such an exception.

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte to this output stream.

Overrides:
write in class java.io.FilterOutputStream
Parameters:
b - the byte to be written to this output stream.
Throws:
java.io.IOException - if the underlying steram throws such an exception.