Package org.jppf.utils.streams
Class NotifyingOutputStream
java.lang.Object
java.io.OutputStream
org.jppf.utils.streams.NotifyingOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Output stream that delegates write operations to an underlying stream,
and sends notifications of how many bytes were written via a callback.
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNotifyingOutputStream(OutputStream delegate, NotifyingStreamCallback callback) Initialize this stream with the specified input stream. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
NotifyingOutputStream
Initialize this stream with the specified input stream.- Parameters:
delegate- the input stream to which operations are delegated.callback- the callback to notify of stream operations.
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-