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 SummaryFields inherited from class java.io.FilterOutputStreamout
- 
Constructor SummaryConstructorsConstructorDescriptionWraps another output stream, counting the number of bytes written.
- 
Method SummaryMethods inherited from class java.io.FilterOutputStreamflush, writeMethods inherited from class java.io.OutputStreamnullOutputStream
- 
Constructor Details- 
CountingOutputStreamWraps another output stream, counting the number of bytes written.- Parameters:
- out- the output stream to be wrapped
 
 
- 
- 
Method Details- 
getCountpublic long getCount()Returns the number of bytes written.
- 
write- Overrides:
- writein class- FilterOutputStream
- Throws:
- IOException
 
- 
write- Overrides:
- writein class- FilterOutputStream
- Throws:
- IOException
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- FilterOutputStream
- Throws:
- IOException
 
 
-