org.freehep.util.io
Class CountedByteOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.freehep.util.io.CountedByteOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class CountedByteOutputStream
extends FilterOutputStream

The CountedByteOutputStream counts the number of bytes written.

Version:
$Id: CountedByteOutputStream.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
CountedByteOutputStream(OutputStream out)
          Creates a Counted Bytes output stream from the given stream.
 
Method Summary
 int getCount()
           
 void write(byte[] b)
           
 void write(byte[] b, int offset, 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

CountedByteOutputStream

public CountedByteOutputStream(OutputStream out)
Creates a Counted Bytes output stream from the given stream.

Parameters:
out - stream to write to
Method Detail

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 offset,
                  int len)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

getCount

public int getCount()
Returns:
number of bytes written.


Copyright © 2000-2007 FreeHEP. All Rights Reserved.