public class NotifyingOutputStream extends OutputStream
| Constructor and Description |
|---|
NotifyingOutputStream(OutputStream underlyingOutputStream,
Consumer<Long> byteCountListener)
Wraps the
underlyingOutputStream to count the bytes written. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
write(byte[] byteArray) |
void |
write(byte[] byteArray,
int offset,
int length) |
void |
write(int singleByte) |
public NotifyingOutputStream(OutputStream underlyingOutputStream, Consumer<Long> byteCountListener)
underlyingOutputStream to count the bytes written.underlyingOutputStream - the wrapped OutputStreambyteCountListener - the byte count Consumerpublic void write(int singleByte)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] byteArray)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] byteArray,
int offset,
int length)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2019. All rights reserved.