public class CountingOutputStream extends FilterOutputStream
out| Constructor and Description |
|---|
CountingOutputStream(OutputStream out)
Constructs a new
FilterOutputStream with out as its
target stream. |
| Modifier and Type | Method and Description |
|---|---|
long |
getCount() |
void |
write(byte[] buffer,
int offset,
int length)
Writes
count bytes from the byte array buffer starting at
offset to the target stream. |
void |
write(int oneByte)
Writes one byte to the target stream.
|
close, flushnullOutputStream, writepublic CountingOutputStream(OutputStream out)
FilterOutputStream with out as its
target stream.out - the target stream that this stream writes to.public void write(byte[] buffer,
int offset,
int length)
throws IOException
FilterOutputStreamcount bytes from the byte array buffer starting at
offset to the target stream.write in class FilterOutputStreambuffer - the buffer to write.offset - the index of the first byte in buffer to write.length - the number of bytes in buffer to write.IOException - if an I/O error occurs while writing to this stream.public void write(int oneByte)
throws IOException
FilterOutputStreamoneByte is written.write in class FilterOutputStreamoneByte - the byte to be written.IOException - if an I/O error occurs while writing to this stream.public long getCount()