Uses of Interface
java.net.http.HttpResponse.BodySubscriber
Packages that use HttpResponse.BodySubscriber
-
Uses of HttpResponse.BodySubscriber in java.net.http
Methods in java.net.http that return HttpResponse.BodySubscriberModifier and TypeMethodDescriptionHttpResponse.BodyHandler.apply(HttpResponse.ResponseInfo responseInfo) Returns aBodySubscriberconsidering the given response status code and headers.static <T> HttpResponse.BodySubscriber<T> HttpResponse.BodySubscribers.buffering(HttpResponse.BodySubscriber<T> downstream, int bufferSize) Returns aBodySubscriberwhich buffers data before delivering it to the given downstream subscriber.static HttpResponse.BodySubscriber<Void> HttpResponse.BodySubscribers.discarding()Returns a response subscriber which discards the response body.static HttpResponse.BodySubscriber<Void> HttpResponse.BodySubscribers.fromLineSubscriber(Flow.Subscriber<? super String> subscriber) Returns a body subscriber that forwards all response body to the givenFlow.Subscriber, line by line.static <S extends Flow.Subscriber<? super String>, T>
HttpResponse.BodySubscriber<T> HttpResponse.BodySubscribers.fromLineSubscriber(S subscriber, Function<? super S, ? extends T> finisher, Charset charset, String lineSeparator) Returns a body subscriber that forwards all response body to the givenFlow.Subscriber, line by line.static HttpResponse.BodySubscriber<Void> HttpResponse.BodySubscribers.fromSubscriber(Flow.Subscriber<? super List<ByteBuffer>> subscriber) Returns a body subscriber that forwards all response body to the givenFlow.Subscriber.static <S extends Flow.Subscriber<? super List<ByteBuffer>>, T>
HttpResponse.BodySubscriber<T> HttpResponse.BodySubscribers.fromSubscriber(S subscriber, Function<? super S, ? extends T> finisher) Returns a body subscriber that forwards all response body to the givenFlow.Subscriber.static <T,U> HttpResponse.BodySubscriber <U> HttpResponse.BodySubscribers.mapping(HttpResponse.BodySubscriber<T> upstream, Function<? super T, ? extends U> mapper) Returns aBodySubscriberwhose response body value is that of the result of applying the given function to the body object of the givenupstreamBodySubscriber.static HttpResponse.BodySubscriber<byte[]> HttpResponse.BodySubscribers.ofByteArray()Returns aBodySubscriberwhich stores the response body as a byte array.static HttpResponse.BodySubscriber<Void> HttpResponse.BodySubscribers.ofByteArrayConsumer(Consumer<Optional<byte[]>> consumer) Returns aBodySubscriberwhich provides the incoming body data to the provided Consumer ofOptional<byte[]>.static HttpResponse.BodySubscriber<Path> Returns aBodySubscriberwhich stores the response body in a file opened with the given name.static HttpResponse.BodySubscriber<Path> HttpResponse.BodySubscribers.ofFile(Path file, OpenOption... openOptions) Returns aBodySubscriberwhich stores the response body in a file opened with the given options and name.HttpResponse.BodySubscribers.ofInputStream()Returns aBodySubscriberwhich streams the response body as anInputStream.static HttpResponse.BodySubscriber<Stream<String>> Returns aBodySubscriberwhich streams the response body as aStream<String>, where each string in the stream corresponds to a line as defined byBufferedReader.lines().HttpResponse.BodySubscribers.ofPublisher()Returns a response subscriber which publishes the response body through aPublisher<List<ByteBuffer>>.static HttpResponse.BodySubscriber<String> Returns a body subscriber which stores the response body as aStringconverted using the givenCharset.static <U> HttpResponse.BodySubscriber<U> HttpResponse.BodySubscribers.replacing(U value) Returns a response subscriber which discards the response body.Methods in java.net.http with parameters of type HttpResponse.BodySubscriberModifier and TypeMethodDescriptionstatic <T> HttpResponse.BodySubscriber<T> HttpResponse.BodySubscribers.buffering(HttpResponse.BodySubscriber<T> downstream, int bufferSize) Returns aBodySubscriberwhich buffers data before delivering it to the given downstream subscriber.static <T,U> HttpResponse.BodySubscriber <U> HttpResponse.BodySubscribers.mapping(HttpResponse.BodySubscriber<T> upstream, Function<? super T, ? extends U> mapper) Returns aBodySubscriberwhose response body value is that of the result of applying the given function to the body object of the givenupstreamBodySubscriber.