Class BlockingOutputStreamAsyncRequestBody
java.lang.Object
software.amazon.awssdk.core.async.BlockingOutputStreamAsyncRequestBody
- All Implemented Interfaces:
org.reactivestreams.Publisher<ByteBuffer>,AsyncRequestBody,SdkPublisher<ByteBuffer>
@SdkPublicApi
public final class BlockingOutputStreamAsyncRequestBody
extends Object
implements AsyncRequestBody
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 ClassesNested classes/interfaces inherited from interface software.amazon.awssdk.core.async.AsyncRequestBody
AsyncRequestBody.BodyType -
Method Summary
Modifier and TypeMethodDescriptionbody()Each AsyncRequestBody should return a well-formed name that can be used to identify the implementation.builder()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, split, splitCloseable, splitCloseableMethods 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>
-
body
Description copied from interface:AsyncRequestBodyEach AsyncRequestBody should return a well-formed name that can be used to identify the implementation. The body name should only include alphanumeric characters.- Specified by:
bodyin interfaceAsyncRequestBody- Returns:
- String containing the identifying name of this AsyncRequestBody implementation.
-