org.apache.jcs.admin
Class CountingOnlyOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.jcs.admin.CountingOnlyOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class CountingOnlyOutputStream
extends java.io.OutputStream

Keeps track of the number of bytes written to it, but doesn't write them anywhere.


Constructor Summary
CountingOnlyOutputStream()
           
 
Method Summary
 int getCount()
          The number of bytes that have passed through this stream.
 void write(byte[] b)
          count as we write.
 void write(byte[] b, int off, int len)
          count as we write.
 void write(int b)
          count as we write.
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountingOnlyOutputStream

public CountingOnlyOutputStream()
Method Detail

write

public void write(byte[] b)
           throws java.io.IOException
count as we write.

Overrides:
write in class java.io.OutputStream
Parameters:
b -
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
count as we write.

Overrides:
write in class java.io.OutputStream
Parameters:
b -
off -
len -
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
count as we write.

Specified by:
write in class java.io.OutputStream
Parameters:
b -
Throws:
java.io.IOException

getCount

public int getCount()
The number of bytes that have passed through this stream.

Returns:
int


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.