Package org.jppf.utils.streams
Class NotifyingInputStream
java.lang.Object
java.io.InputStream
org.jppf.utils.streams.NotifyingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Input stream that delegates read and skip operations to an underlying stream,
and sends notifications of how many bytes were read or skipped via a callback.
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNotifyingInputStream(InputStream delegate, NotifyingStreamCallback callback) Initialize this stream with the specified input stream. -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
NotifyingInputStream
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
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-