Top Inners Constructors Methods
jdk.internal.net.http

public Class ResponseSubscribers

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .FilePermission, .IOException, .InputStream, .InputStreamReader, java.nio.ByteBuffer, java.nio.channels.FileChannel, java.nio.charset.Charset, java.nio.file.OpenOption, .Path, java.security.AccessControlContext, .AccessController, .PrivilegedAction, .PrivilegedActionException, .PrivilegedExceptionAction, java.util.ArrayList, .Iterator, .List, .Objects, .Optional, java.util.concurrent.ArrayBlockingQueue, .BlockingQueue, .CompletableFuture, .CompletionStage, .Executor, .Flow, .Flow.Subscriber, .Flow.Subscription, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, java.util.function.Consumer, .Function, java.util.stream.Stream, java.net.http.HttpResponse.BodySubscriber, jdk.internal.net.http.common.Log, .Logger, .MinimalFuture, .Utils, jdk.internal.net.http.HttpClientImpl.DelegatingExecutor

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
ResponseSubscribers.HttpResponseInputStream

An InputStream built on top of the Flow API.

public static class
ResponseSubscribers.MappingSubscriber<
the upstream body type
T
,
this subscriber's body type
U
>

A body subscriber which receives input from an upstream subscriber and maps that subscriber's body type to a new type.

public static class
ResponseSubscribers.NullSubscriber<T>

Currently this consumes all of the data and ignores it

public static class
ResponseSubscribers.PathSubscriber

A Subscriber that writes the flow of data to a given file.

pack-priv static class
public static class
ResponseSubscribers.SubscriberAdapter<S extends Flow.Subscriber<? super List<ByteBuffer>>, R>

An adapter between BodySubscriber and Flow.Subscriber.

public static interface
ResponseSubscribers.TrustedSubscriber<
The response type.
T
>

This interface is used by our BodySubscriber implementations to declare whether calling getBody() inline is safe, or whether it needs to be called asynchronously in an executor thread.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static HttpResponse.BodySubscriber<Stream<String>>
public static HttpResponse.BodySubscriber<Stream<String>>
public static HttpResponse.BodySubscriber<Flow.Publisher<List<ByteBuffer>>>
public static <
The type of the response.
T
>
CompletionStage<T>

Returns:

A completion stage that completes when the completion stage returned by bs::getBody completes. This may, or may not, be the same completion stage.
getBodyAsync
(Executor
The executor to use if an executor is required.
e
,
HttpResponse.BodySubscriber<T>
The BodySubscriber (trusted or not)
bs
)

Tries to determine whether bs::getBody must be invoked asynchronously, and if so, uses the provided executor to do it.

public static <
The response type.
T
>
CompletableFuture<T>

Returns:

The provided cf.
getBodyAsync
(Executor
The executor that should be used to call bs::getBody
e
,
HttpResponse.BodySubscriber<T>
The BodySubscriber
bs
,
CompletableFuture<T>
A completable future that this function will set up to complete when the completion stage returned by bs::getBody completes. In case of any error while trying to set up the completion chain, cf will be completed exceptionally with that error.
cf
)

Invokes bs::getBody using the provided executor.

public static <
The response type.
T
>
CompletableFuture<T>

Returns:

The provide cf. If the errorHandler is invoked, it is the responsibility of the errorHandler to complete the cf, if needed.
getBodyAsync
(Executor
The executor that should be used to call bs::getBody
e
,
HttpResponse.BodySubscriber<T>
The BodySubscriber
bs
,
CompletableFuture<T>
A completable future that this function will set up to complete when the completion stage returned by bs::getBody completes. In case of any error while trying to set up the completion chain, cf will be completed exceptionally with that error.
cf
,
Consumer<Throwable>
The handler to invoke if an error is raised while trying to set up the completion chain.
errorHandler
)

Invokes bs::getBody using the provided executor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait