Package com.itextpdf.kernel.xmp.impl
Class CountOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.itextpdf.kernel.xmp.impl.CountOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public final class CountOutputStream extends java.io.OutputStreamAnOutputStreamthat counts the written bytes.- Since:
- 08.11.2006
-
-
Field Summary
Fields Modifier and Type Field Description private intbytesWrittenthe byte counterprivate java.io.OutputStreamoutputthe decorated output stream
-
Constructor Summary
Constructors Constructor Description CountOutputStream(java.io.OutputStream output)Constructor with providing the output stream to decorate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBytesWritten()voidwrite(byte[] buf)Counts the written bytes.voidwrite(byte[] buf, int off, int len)Counts the written bytes.voidwrite(int b)Counts the written bytes.
-
-
-
Method Detail
-
write
public void write(byte[] buf, int off, int len) throws java.io.IOExceptionCounts the written bytes.- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException- See Also:
OutputStream.write(byte[], int, int)
-
write
public void write(byte[] buf) throws java.io.IOExceptionCounts the written bytes.- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException- See Also:
OutputStream.write(byte[])
-
write
public void write(int b) throws java.io.IOExceptionCounts the written bytes.- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException- See Also:
OutputStream.write(int)
-
getBytesWritten
public int getBytesWritten()
- Returns:
- the bytesWritten
-
-