Package com.helger.commons.io.stream
Class CountingFileOutputStream
java.lang.Object
java.io.OutputStream
java.io.FileOutputStream
com.helger.commons.io.stream.CountingFileOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
A special
FileOutputStream sub class that keeps track of all written
bytes for the statistics handler.- Author:
- Philip Helger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCountingFileOutputStream(File aFile) CountingFileOutputStream(File aFile, EAppend eAppend) CountingFileOutputStream(String sFilename) CountingFileOutputStream(String sFilename, EAppend eAppend) -
Method Summary
Methods inherited from class java.io.FileOutputStream
close, getChannel, getFDMethods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Field Details
-
DEFAULT_APPEND
By default append is enabled
-
-
Constructor Details
-
CountingFileOutputStream
- Throws:
FileNotFoundException
-
CountingFileOutputStream
public CountingFileOutputStream(@Nonnull File aFile, @Nonnull EAppend eAppend) throws FileNotFoundException - Throws:
FileNotFoundException
-
CountingFileOutputStream
- Throws:
FileNotFoundException
-
CountingFileOutputStream
public CountingFileOutputStream(@Nonnull String sFilename, @Nonnull EAppend eAppend) throws FileNotFoundException - Throws:
FileNotFoundException
-
-
Method Details
-
write
- Overrides:
writein classFileOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFileOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFileOutputStream- Throws:
IOException
-
getBytesWritten
-
toString
-