Package com.aoindustries.io
Class ByteCountOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.aoindustries.io.ByteCountOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class ByteCountOutputStream extends FilterOutputStream
Wraps an OutputStream to count the number of bytes transferred. The counter is not synchronized. Any necessary synchronization should be externally applied.- Author:
- AO Industries, Inc.
-
-
Field Summary
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description ByteCountOutputStream(OutputStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCount()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.FilterOutputStream
close, flush
-
-
-
-
Constructor Detail
-
ByteCountOutputStream
public ByteCountOutputStream(OutputStream out)
-
-
Method Detail
-
write
public void write(int b) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
getCount
public long getCount()
-
-