public class PublisherInputStream extends InputStream implements Flow.Publisher<DataChunk>
subscriber that can subscribe to a source of ByteBuffer data chunks and then make
them available for consumption via standard blocking InputStream API.| Constructor and Description |
|---|
PublisherInputStream(Flow.Publisher<DataChunk> originalPublisher)
Wraps the supplied publisher and adds a blocking
InputStream based nature. |
| Modifier and Type | Method and Description |
|---|---|
int |
read() |
void |
subscribe(Flow.Subscriber<? super DataChunk> subscriber)
Adds the given Subscriber if possible.
|
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTopublic PublisherInputStream(Flow.Publisher<DataChunk> originalPublisher)
InputStream based nature.
It is illegal to subscribe to the returned publisher.originalPublisher - the original publisher to wrappublic int read()
throws IOException
read in class InputStreamIOExceptionpublic void subscribe(Flow.Subscriber<? super DataChunk> subscriber)
Flow.PublisheronError
method is invoked with an IllegalStateException.
Otherwise, the Subscriber's onSubscribe method is
invoked with a new Flow.Subscription. Subscribers may
enable receiving items by invoking the request
method of this Subscription, and may unsubscribe by
invoking its cancel method.subscribe in interface Flow.Publisher<DataChunk>subscriber - the subscriberCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.