java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable@Beta @GwtIncompatible public final class CountingOutputStream extends java.io.FilterOutputStream
| Constructor | Description |
|---|---|
CountingOutputStream(java.io.OutputStream out) |
Wraps another output stream, counting the number of bytes written.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
long |
getCount() |
Returns the number of bytes written.
|
void |
write(byte[] b,
int off,
int len) |
|
void |
write(int b) |
public CountingOutputStream(java.io.OutputStream out)
out - the output stream to be wrappedpublic long getCount()
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.FilterOutputStreamjava.io.IOException