public class CountingOutputstream
extends java.io.OutputStream
OutputStream
and delegates
the write calls.getCount()
.Modifier and Type | Field and Description |
---|---|
private long |
count
Stores the amount of bytes written.
|
private java.io.OutputStream |
wrapped
The stream to forward the write calls.
|
Constructor and Description |
---|
CountingOutputstream(java.io.OutputStream outputStream)
Creates an instance which will delegate the write calls to the given
output stream.
|
private long count
private final java.io.OutputStream wrapped
public CountingOutputstream(java.io.OutputStream outputStream)
outputStream
- stream to wrap.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public long getCount()
public void write(byte[] bytes) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] bytes, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int toWrite) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
Copyright © 2005-2013 java.net. All Rights Reserved.