Class BlockingOutputStreamAsyncRequestBody
java.lang.Object
software.amazon.awssdk.core.async.BlockingOutputStreamAsyncRequestBody
- All Implemented Interfaces:
org.reactivestreams.Publisher<ByteBuffer>,AsyncRequestBody,SdkPublisher<ByteBuffer>
An implementation of
AsyncRequestBody that allows performing a blocking write of an output stream to a downstream
service.
The caller is responsible for calling OutputStream.close() on the outputStream() when writing is
complete.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a default builder forBlockingOutputStreamAsyncRequestBody.Return an output stream to which blocking writes can be made to the downstream service.voidsubscribe(org.reactivestreams.Subscriber<? super ByteBuffer> s) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.core.async.AsyncRequestBody
contentType, split, splitMethods inherited from interface software.amazon.awssdk.core.async.SdkPublisher
addTrailingData, buffer, doAfterOnCancel, doAfterOnComplete, doAfterOnError, filter, filter, flatMapIterable, limit, map, subscribe
-
Method Details
-
outputStream
Return an output stream to which blocking writes can be made to the downstream service.This method will block the calling thread until the SDK is connected to the service. This means that this request body should usually be passed to the SDK before this method is called.
You can invoke
CancellableOutputStream.cancel()to cancel any blocked write calls to the downstream service (and mark the stream as failed). -
builder
Creates a default builder forBlockingOutputStreamAsyncRequestBody. -
contentLength
- Specified by:
contentLengthin interfaceAsyncRequestBody- Returns:
- The content length of the data being produced.
-
subscribe
- Specified by:
subscribein interfaceorg.reactivestreams.Publisher<ByteBuffer>
-