org.apache.lucene.util
Class CountedOutputStream
Object
OutputStream
FilterOutputStream
CountedOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class CountedOutputStream
- extends FilterOutputStream
Wraps an OutputStream, and counts how many bytes have been written to it.
- Author:
- Martin Haye
Field Summary |
private long |
nWritten
Count of the number of bytes written to the stream so far |
Fields inherited from class FilterOutputStream |
out |
Method Summary |
long |
nWritten()
Find out how many bytes have been written so far |
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
Methods inherited from class FilterOutputStream |
close, flush, write |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nWritten
private long nWritten
- Count of the number of bytes written to the stream so far
CountedOutputStream
public CountedOutputStream(OutputStream out)
- Wrap an output stream
nWritten
public long nWritten()
- Find out how many bytes have been written so far
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
write
public void write(int b)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException