Package i2p.susi.util
Class CountingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- i2p.susi.util.CountingOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class CountingOutputStream extends FilterOutputStream
An OutputStream that counts how many bytes are written and returns the count via getWritten().- Since:
- 0.9.34
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description CountingOutputStream(OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getWritten()
void
write(byte[] src, int off, int len)
void
write(int val)
-
Methods inherited from class java.io.FilterOutputStream
close, flush, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
CountingOutputStream
public CountingOutputStream(OutputStream out)
-
-
Method Detail
-
getWritten
public long getWritten()
-
write
public void write(int val) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
public void write(byte[] src, int off, int len) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
-