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 java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionWraps another output stream, counting the number of bytes written. -
Method Summary
Methods inherited from class java.io.FilterOutputStream
flush, write
Methods inherited from class java.io.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
Returns the number of bytes written. -
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-