Class ByteBuffersAsyncRequestBody
java.lang.Object
software.amazon.awssdk.core.internal.async.ByteBuffersAsyncRequestBody
- All Implemented Interfaces:
AutoCloseable
,org.reactivestreams.Publisher<ByteBuffer>
,AsyncRequestBody
,SdkPublisher<ByteBuffer>
,SdkAutoCloseable
public final class ByteBuffersAsyncRequestBody
extends Object
implements AsyncRequestBody, SdkAutoCloseable
An implementation of
AsyncRequestBody
for providing data from the supplied ByteBuffer
array. This is created
using static methods on AsyncRequestBody
Subscription Behavior:
- Each subscriber receives a read-only view of the buffered data
- Subscribers receive data independently based on their own demand signaling
- If the body is closed, new subscribers will receive an error immediately
Resource Management:
The body should be closed when no longer needed to free buffered data and notify active subscribers. Closing the body will:- Clear all buffered data
- Send error notifications to all active subscribers
- Prevent new subscriptions
- See Also:
-
Nested Class Summary
Nested 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.void
close()
static ByteBuffersAsyncRequestBody
from
(byte[] bytes) static ByteBuffersAsyncRequestBody
static ByteBuffersAsyncRequestBody
of
(Long length, ByteBuffer... buffers) static ByteBuffersAsyncRequestBody
of
(String mimetype, Long length, ByteBuffer... buffers) static ByteBuffersAsyncRequestBody
of
(String mimetype, ByteBuffer... buffers) static ByteBuffersAsyncRequestBody
of
(ByteBuffer... buffers) static ByteBuffersAsyncRequestBody
of
(List<ByteBuffer> buffers) static ByteBuffersAsyncRequestBody
of
(List<ByteBuffer> buffers, long length) void
subscribe
(org.reactivestreams.Subscriber<? super ByteBuffer> subscriber) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.core.async.AsyncRequestBody
split, split, splitCloseable, splitCloseable
Methods inherited from interface software.amazon.awssdk.core.async.SdkPublisher
addTrailingData, buffer, doAfterOnCancel, doAfterOnComplete, doAfterOnError, filter, filter, flatMapIterable, limit, map, subscribe
-
Method Details
-
contentLength
- Specified by:
contentLength
in interfaceAsyncRequestBody
- Returns:
- The content length of the data being produced.
-
contentType
- Specified by:
contentType
in interfaceAsyncRequestBody
- Returns:
- The content type of the data being produced.
-
subscribe
- Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<ByteBuffer>
-
body
Description copied from interface:AsyncRequestBody
Each 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:
body
in interfaceAsyncRequestBody
- Returns:
- String containing the identifying name of this AsyncRequestBody implementation.
-
of
-
of
-
of
-
of
-
of
-
of
-
from
-
from
-
close
public void close()Description copied from interface:SdkAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
bufferedData
-