Class CountOutputStream
java.lang.Object
java.io.OutputStream
com.itextpdf.kernel.pdf.CountOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
An
OutputStream that counts the written bytes.
You should not use same instance of this class in different threads as far as it's not thread safe.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCountOutputStream(OutputStream outputStream) Creates an instance of output stream which counts written bytes. -
Method Summary
Methods inherited from class OutputStream
nullOutputStream
-
Field Details
-
outputStream
-
amountOfWrittenBytes
private long amountOfWrittenBytes
-
-
Constructor Details
-
CountOutputStream
Creates an instance of output stream which counts written bytes.- Parameters:
outputStream- innerOutputStream
-
-
Method Details
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
getAmountOfWrittenBytes
public long getAmountOfWrittenBytes()Gets amount of bytes written to the inner output stream.- Returns:
- amount of bytes
-