Package org.apache.wicket.util.io
Class ByteCountingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.wicket.util.io.ByteCountingOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public final class ByteCountingOutputStream extends OutputStream
Output stream that counts bytes written to it (but discards them).- Author:
- Jonathan Locke
-
-
Constructor Summary
Constructors Constructor Description ByteCountingOutputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
size()
void
write(byte[] b, int off, int len)
void
write(int b)
-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write
-
-
-
-
Constructor Detail
-
ByteCountingOutputStream
public ByteCountingOutputStream()
-
-
Method Detail
-
write
public void write(int b) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
- See Also:
OutputStream.write(int)
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
- See Also:
OutputStream.write(byte[], int, int)
-
size
public long size()
- Returns:
- Number of bytes written to this stream
-
-