Package io.datarouter.bytes
Class CountingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
io.datarouter.bytes.CountingOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionCountingOutputStream(OutputStream outputStream) CountingOutputStream(OutputStream outputStream, int countInterval, Consumer<Long> countCallback) -
Method Summary
Methods inherited from class java.io.FilterOutputStream
flush, writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
CountingOutputStream
-
CountingOutputStream
public CountingOutputStream(OutputStream outputStream, int countInterval, Consumer<Long> countCallback)
-
-
Method Details
-
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
-
getCount
public long getCount()
-