public final class BlockingInputStreamAsyncRequestBody extends Object implements AsyncRequestBody
AsyncRequestBody that allows performing a blocking write of an input stream to a downstream
service.
| Modifier and Type | Class and Description |
|---|---|
static class |
BlockingInputStreamAsyncRequestBody.Builder |
| Modifier and Type | Method and Description |
|---|---|
static BlockingInputStreamAsyncRequestBody.Builder |
builder()
Creates a default builder for
BlockingInputStreamAsyncRequestBody. |
void |
cancel()
Cancel any running write (and mark the stream as failed).
|
Optional<Long> |
contentLength() |
String |
contentType() |
void |
subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s) |
long |
writeInputStream(InputStream inputStream)
Block the calling thread and write the provided input stream to the downstream service.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitempty, forBlockingInputStream, forBlockingOutputStream, fromByteBuffer, fromByteBuffers, fromByteBuffersUnsafe, fromByteBufferUnsafe, fromBytes, fromBytesUnsafe, fromFile, fromFile, fromFile, fromFile, fromInputStream, fromInputStream, fromInputStream, fromPublisher, fromRemainingByteBuffer, fromRemainingByteBuffers, fromRemainingByteBuffersUnsafe, fromRemainingByteBufferUnsafe, fromString, fromString, split, splitadapt, addTrailingData, buffer, doAfterOnCancel, doAfterOnComplete, doAfterOnError, filter, filter, flatMapIterable, fromIterable, limit, map, subscribepublic static BlockingInputStreamAsyncRequestBody.Builder builder()
BlockingInputStreamAsyncRequestBody.public Optional<Long> contentLength()
contentLength in interface AsyncRequestBodypublic String contentType()
contentType in interface AsyncRequestBodypublic long writeInputStream(InputStream inputStream)
This method will block the calling thread immediately. This means that this request body should usually be passed to the SDK before this method is called.
This method will return the amount of data written when the entire input stream has been written. This will throw an exception if writing the input stream has failed.
You can invoke cancel() to cancel any blocked write calls to the downstream service (and mark the stream as
failed).
public void cancel()
public void subscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s)
subscribe in interface org.reactivestreams.Publisher<ByteBuffer>Copyright © 2026. All rights reserved.