Package com.itextpdf.kernel.pdf
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.
-
Constructor Summary
ConstructorDescriptionCountOutputStream
(OutputStream outputStream) Creates an instance of output stream which counts written bytes. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
CountOutputStream
Creates an instance of output stream which counts written bytes.- Parameters:
-
outputStream
- innerOutputStream
-
-
Method Details
-
write
- Overrides:
-
write
in classOutputStream
- Throws:
-
IOException
-
write
- Overrides:
-
write
in classOutputStream
- Throws:
-
IOException
-
write
- Specified by:
-
write
in classOutputStream
- Throws:
-
IOException
-
flush
- Specified by:
-
flush
in interfaceFlushable
- Overrides:
-
flush
in classOutputStream
- Throws:
-
IOException
-
close
- Specified by:
-
close
in interfaceAutoCloseable
- Specified by:
-
close
in interfaceCloseable
- Overrides:
-
close
in classOutputStream
- Throws:
-
IOException
-
getAmountOfWrittenBytes
public long getAmountOfWrittenBytes()Gets amount of bytes written to the inner output stream.- Returns:
- amount of bytes
-