public interface InputStreamOpener
| Modifier and Type | Method and Description |
|---|---|
InputStream |
openStream(CancellationToken cancelToken)
Opens a new stream to the source defined by this
InputStreamOpener instance. |
InputStream openStream(CancellationToken cancelToken) throws IOException
InputStreamOpener instance. This method opens a new stream each
time it is called an these opened channels must be
closed separately.cancelToken - the CancellationToken through which callers
may notify this method that the channel is no longer need to be
opened. Implementations are free to ignore this request but if they
don't, they must throw an OperationCanceledException
in response to the cancellation request. This argument cannot be
null.InputStreamOpener instance. The returned instance must be
closed in order to prevent resource
leakage. This method never returns null.OperationCanceledException - thrown if
cancellation was detected by this methodIOException - thrown if the stream could not be opened for some
reasons