Package org.eclipse.jgit.util.io
Class CountingOutputStream
java.lang.Object
java.io.OutputStream
org.eclipse.jgit.util.io.CountingOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Counts the number of bytes written.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
write
-
Field Details
-
out
-
cnt
private long cnt
-
-
Constructor Details
-
CountingOutputStream
Initialize a new counting stream.- Parameters:
out
- stream to output all writes to.
-
-
Method Details
-
getCount
public long getCount()Get current number of bytes written.- Returns:
- current number of bytes written.
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-