de.schlichtherle.io
Class CountingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
de.schlichtherle.io.CountingOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
final class CountingOutputStream
- extends FilterOutputStream
An output stream which logs the number of bytes written.
- Since:
- TrueZIP 6.5
- Author:
- Christian Schlichtherle
|
Field Summary |
private static boolean |
reset
|
private static long |
total
|
|
Method Summary |
(package private) static long |
getTotal()
Returns the total number of bytes written. |
(package private) static void |
init()
Resets the total number of bytes written if resetOnInit() has
been called before. |
(package private) static void |
resetOnInit()
Requests that the total number of bytes written gets reset on the
next call to init(). |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
total
private static volatile long total
reset
private static volatile boolean reset
CountingOutputStream
CountingOutputStream(OutputStream out)
getTotal
static long getTotal()
- Returns the total number of bytes written.
init
static void init()
- Resets the total number of bytes written if
resetOnInit() has
been called before.
resetOnInit
static void resetOnInit()
- Requests that the total number of bytes written gets reset on the
next call to
init().
write
public void write(int b)
throws IOException
- Overrides:
write in class FilterOutputStream
- Throws:
IOException
write
public void write(byte[] b)
throws IOException
- Overrides:
write in class FilterOutputStream
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write in class FilterOutputStream
- Throws:
IOException
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.