Class PublisherInputStream

    • Constructor Detail

      • PublisherInputStream

        public PublisherInputStream​(Flow.Publisher<DataChunk> originalPublisher)
        Wraps the supplied publisher and adds a blocking InputStream based nature. It is illegal to subscribe to the returned publisher.
        Parameters:
        originalPublisher - the original publisher to wrap
    • Method Detail

      • subscribe

        public void subscribe​(Flow.Subscriber<? super DataChunk> subscriber)
        Description copied from interface: Flow.Publisher
        Adds the given Subscriber if possible. If already subscribed, or the attempt to subscribe fails due to policy violations or errors, the Subscriber's onError 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.
        Specified by:
        subscribe in interface Flow.Publisher<DataChunk>
        Parameters:
        subscriber - the subscriber