Package marauroa.common.net
Class ByteCounterOutputStream
java.lang.Object
java.io.OutputStream
marauroa.common.net.ByteCounterOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
This class just counts the bytes written into underlaying outputstream
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
ByteCounterOutputStream
Constructor- Parameters:
os- the output stream to count.
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
getBytesWritten
public long getBytesWritten()Returns the amount of bytes written.- Returns:
- the amount of bytes written.
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-