public class ListenableCountingOutputStream extends OutputStream
| Constructor and Description |
|---|
ListenableCountingOutputStream(OutputStream underlyingOutputStream,
Consumer<Long> byteCountConsumer,
Duration delayBetweenCallbacks)
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 ListenableCountingOutputStream(OutputStream underlyingOutputStream, Consumer<Long> byteCountConsumer, Duration delayBetweenCallbacks)
underlyingOutputStream to count the bytes written.underlyingOutputStream - the wrapped OutputStreambyteCountConsumer - the byte count ConsumerdelayBetweenCallbacks - the minimum delay between each call to byteCountConsumerpublic 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.