org.entityfs.support.io
Class CountingOutputStream
java.lang.Object
java.io.OutputStream
org.entityfs.support.io.OutputStreamProxy
org.entityfs.support.io.CountingOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class CountingOutputStream
- extends OutputStreamProxy
This OutputStream
wraps another OutputStream
and counts the
number of bytes that are written to it.
- Since:
- 1.1
- Author:
- Karl Gustafsson
- See Also:
CountingInputStream
CountingOutputStream
public CountingOutputStream(OutputStream wrapped)
write
public void write(int b)
throws IOException
- Overrides:
write
in class OutputStreamProxy
- Throws:
IOException
write
public void write(byte[] b)
throws IOException
- Overrides:
write
in class OutputStreamProxy
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write
in class OutputStreamProxy
- Throws:
IOException
getNoOfBytesWritten
public long getNoOfBytesWritten()
- Get the number of bytes that have been written to the wrapped
OutputStream
.
- Returns:
- The number of bytes that have been written to the wrapped stream.