Package io.micronaut.http.body
Class ByteBufferBodyAdapter
java.lang.Object
io.micronaut.http.body.AbstractBodyAdapter<ByteBuffer,ReactiveByteBufferByteBody.SharedBuffer>
io.micronaut.http.body.ByteBufferBodyAdapter
- All Implemented Interfaces:
BufferConsumer.Upstream
,Subscriber<ByteBuffer>
public final class ByteBufferBodyAdapter
extends AbstractBodyAdapter<ByteBuffer,ReactiveByteBufferByteBody.SharedBuffer>
- Since:
- 4.8.0
- Author:
- Jonas Konrad
-
Field Summary
Fields inherited from class io.micronaut.http.body.AbstractBodyAdapter
demand, sharedBuffer, subscription
-
Method Summary
Modifier and TypeMethodDescriptionstatic CloseableByteBody
adapt
(@NonNull Publisher<ByteBuffer> publisher, @NonNull OptionalLong contentLength) Create a new body from the given publisher.void
onNext
(ByteBuffer buffer) Methods inherited from class io.micronaut.http.body.AbstractBodyAdapter
allowDiscard, disregardBackpressure, onBytesConsumed, onComplete, onError, onSubscribe, start
-
Method Details
-
adapt
public static CloseableByteBody adapt(@NonNull @NonNull Publisher<ByteBuffer> publisher, @NonNull @NonNull OptionalLong contentLength) Create a new body from the given publisher.- Parameters:
publisher
- The input publishercontentLength
- Optional length of the body, must match the publisher exactly- Returns:
- The ByteBody fed by the publisher
-
onNext
-