インタフェースjava.net.http.HttpResponse.BodySubscriberの
使用
パッケージ | 説明 |
---|---|
java.net.http |
HTTPクライアントおよびWebSocket API
|
-
java.net.httpでのHttpResponse.BodySubscriberの使用
HttpResponse.BodySubscriberを返すjava.net.httpのメソッド 修飾子と型 メソッド 説明 HttpResponse.BodySubscriber<T>
HttpResponse.BodyHandler. apply(HttpResponse.ResponseInfo responseInfo)
与えられたレスポンス・ステータス・コードとヘッダーを考慮してBodySubscriber
を返します。static <T> HttpResponse.BodySubscriber<T>
HttpResponse.BodySubscribers. buffering(HttpResponse.BodySubscriber<T> downstream, int bufferSize)
特定のダウンストリーム・サブスクライバにデータを配信する前にデータをバッファリングするBodySubscriber
を返します。static HttpResponse.BodySubscriber<Void>
HttpResponse.BodySubscribers. discarding()
レスポンス本文を破棄するレスポンス・サブスクライバを返します。static HttpResponse.BodySubscriber<Void>
HttpResponse.BodySubscribers. fromLineSubscriber(Flow.Subscriber<? super String> subscriber)
指定されたFlow.Subscriber
の行ごとにすべてのレスポンス本文を転送する本体サブスクライバを返します。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)
指定されたFlow.Subscriber
の行ごとにすべてのレスポンス本文を転送する本体サブスクライバを返します。static HttpResponse.BodySubscriber<Void>
HttpResponse.BodySubscribers. fromSubscriber(Flow.Subscriber<? super List<ByteBuffer>> subscriber)
すべてのレスポンス本文を指定されたFlow.Subscriber
に転送する本文サブスクライバを返します。static <S extends Flow.Subscriber<? super List<ByteBuffer>>, T>
HttpResponse.BodySubscriber<T>HttpResponse.BodySubscribers. fromSubscriber(S subscriber, Function<? super S,? extends T> finisher)
すべてのレスポンス本文を指定されたFlow.Subscriber
に転送する本文サブスクライバを返します。static <T, U> HttpResponse.BodySubscriber<U>
HttpResponse.BodySubscribers. mapping(HttpResponse.BodySubscriber<T> upstream, Function<? super T,? extends U> mapper)
指定されたupstream
BodySubscriber
の本体オブジェクトに指定された関数を適用した結果がレスポンス本文の値であるBodySubscriber
を返します。static HttpResponse.BodySubscriber<byte[]>
HttpResponse.BodySubscribers. ofByteArray()
レスポンス本文をバイト配列として格納するBodySubscriber
を返します。static HttpResponse.BodySubscriber<Void>
HttpResponse.BodySubscribers. ofByteArrayConsumer(Consumer<Optional<byte[]>> consumer)
提供されたOptional<byte[]>
のコンシューマに着信する本文データを提供するBodySubscriber
を返します。static HttpResponse.BodySubscriber<Path>
HttpResponse.BodySubscribers. ofFile(Path file)
指定された名前でオープンされたファイルにレスポンス本文を格納するBodySubscriber
を返します。static HttpResponse.BodySubscriber<Path>
HttpResponse.BodySubscribers. ofFile(Path file, OpenOption... openOptions)
与えられたオプションと名前でオープンされたファイルにレスポンス本文を格納するBodySubscriber
を返します。static HttpResponse.BodySubscriber<InputStream>
HttpResponse.BodySubscribers. ofInputStream()
レスポンス本文をInputStream
としてストリームするBodySubscriber
を返します。static HttpResponse.BodySubscriber<Stream<String>>
HttpResponse.BodySubscribers. ofLines(Charset charset)
レスポンス本文をStream
<String>
としてストリームするBodySubscriber
を返します。このStream
<String>
は、ストリーム内の各文字列が、BufferedReader.lines()
で定義された行に対応します。static HttpResponse.BodySubscriber<Flow.Publisher<List<ByteBuffer>>>
HttpResponse.BodySubscribers. ofPublisher()
Publisher<List<ByteBuffer>>
を介してレスポンス本文をパブリッシュするレスポンス・サブスクライバを返します。static HttpResponse.BodySubscriber<String>
HttpResponse.BodySubscribers. ofString(Charset charset)
指定されたCharset
を使用して変換されたString
としてレスポンス本文を格納する本文サブスクライバを返します。static <U> HttpResponse.BodySubscriber<U>
HttpResponse.BodySubscribers. replacing(U value)
レスポンス本文を破棄するレスポンス・サブスクライバを返します。型HttpResponse.BodySubscriberのパラメータを持つjava.net.httpのメソッド 修飾子と型 メソッド 説明 static <T> HttpResponse.BodySubscriber<T>
HttpResponse.BodySubscribers. buffering(HttpResponse.BodySubscriber<T> downstream, int bufferSize)
特定のダウンストリーム・サブスクライバにデータを配信する前にデータをバッファリングするBodySubscriber
を返します。static <T, U> HttpResponse.BodySubscriber<U>
HttpResponse.BodySubscribers. mapping(HttpResponse.BodySubscriber<T> upstream, Function<? super T,? extends U> mapper)
指定されたupstream
BodySubscriber
の本体オブジェクトに指定された関数を適用した結果がレスポンス本文の値であるBodySubscriber
を返します。