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