Class CountingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.google.common.io.CountingOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
An OutputStream that counts the number of bytes written.
- Since:
- 1.0
- Author:
- Chris Nokleberg
-
Field Summary
Fields inherited from class FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionWraps another output stream, counting the number of bytes written. -
Method Summary
Methods inherited from class FilterOutputStream
flush, writeMethods inherited from class OutputStream
nullOutputStream
-
Constructor Details
-
CountingOutputStream
Wraps another output stream, counting the number of bytes written.- Parameters:
out- the output stream to be wrapped
-
-
Method Details
-
getCount
public long getCount()Returns the number of bytes written. -
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-