ch.javasoft.io
Class LengthTrackingOutputStream
java.lang.Object
java.io.OutputStream
ch.javasoft.io.LengthTrackingOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class LengthTrackingOutputStream
- extends OutputStream
The LengthTrackingOutputStream simply pipes the data written to it
to an underlying output stream, but tracks the length of the written bytes
at the same time.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LengthTrackingOutputStream
public LengthTrackingOutputStream(OutputStream out)
resetLength
public void resetLength()
getLength
public int getLength()
write
public void write(int b)
throws IOException
- Specified by:
write in class OutputStream
- Throws:
IOException
write
public void write(byte[] b)
throws IOException
- Overrides:
write in class OutputStream
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write in class OutputStream
- Throws:
IOException