Class ByteCountOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
fr.ens.biologie.genomique.eoulsan.io.ByteCountOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
This class define a filter that count the number of written bytes by an InputStream.
- Since:
- 1.0
- Author:
- Laurent Jourdren
-
Constructor Summary
ConstructorsConstructorDescriptionPublic constructor.ByteCountOutputStream(OutputStream os, long attemptedNWritten) Public constructor. -
Method Summary
Methods inherited from class java.io.FilterOutputStream
flushMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ByteCountOutputStream
Public constructor.- Parameters:
os- output stream
-
ByteCountOutputStream
Public constructor.- Parameters:
os- output streamattemptedNWritten- attempt write count
-
-
Method Details
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
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
-
getBytesNumberWritten
public long getBytesNumberWritten()Get the number of bytes written.- Returns:
- the number of bytes written
-