dk.brics.xact.operations
Class LengthOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by dk.brics.xact.operations.LengthOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class LengthOutputStream
extends OutputStream

Output stream that counts the number of bytes written.


Constructor Summary
LengthOutputStream()
          Constructs a new length output stream.
 
Method Summary
 int getLength()
          Returns the number of bytes written.
 void reset()
          Resets the byte counter.
 void write(int b)
          Writes a byte.
 
Methods inherited from class java.io.OutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LengthOutputStream

public LengthOutputStream()
Constructs a new length output stream.

Method Detail

getLength

public int getLength()
Returns the number of bytes written.


reset

public void reset()
Resets the byte counter.


write

public void write(int b)
Writes a byte.

Specified by:
write in class OutputStream


Copyright © 2005-2011 Aarhus University.