public class CountOutputStream extends OutputStream
OutputStream
implementation that delegates all method calls to a provided OutputStream
while timing all method calls and counting how many
bytes are written by this OutputStream
.Constructor and Description |
---|
CountOutputStream(OutputStream os)
Constructs a new CountOutputStream that delegates to the given
OutputStream . |
public CountOutputStream(OutputStream os)
OutputStream
.os
- the delegate OutputStream
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException