Package io.micronaut.http.body
Class ConcatenatingSubscriber.ByteBufferConcatenatingSubscriber
java.lang.Object
io.micronaut.http.body.ConcatenatingSubscriber
io.micronaut.http.body.ConcatenatingSubscriber.ByteBufferConcatenatingSubscriber
- All Implemented Interfaces:
BufferConsumer
,BufferConsumer.Upstream
,Subscriber<ByteBody>
,reactor.core.CoreSubscriber<ByteBody>
- Direct Known Subclasses:
ConcatenatingSubscriber.JsonByteBufferConcatenatingSubscriber
- Enclosing class:
- ConcatenatingSubscriber
public static class ConcatenatingSubscriber.ByteBufferConcatenatingSubscriber
extends ConcatenatingSubscriber
Concatenating implementation that writes to a
ReactiveByteBufferByteBody
.-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.http.body.ConcatenatingSubscriber
ConcatenatingSubscriber.ByteBufferConcatenatingSubscriber, ConcatenatingSubscriber.JsonByteBufferConcatenatingSubscriber
Nested classes/interfaces inherited from interface io.micronaut.http.body.stream.BufferConsumer
BufferConsumer.Upstream
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(@NonNull ByteBuffer buffer) static CloseableByteBody
concatenate
(Publisher<ByteBody> publisher) protected BufferConsumer.Upstream
Forward the given body to the shared buffer.protected void
Forward completion to the shared buffer.protected void
Forward an error to the shared buffer.Methods inherited from class io.micronaut.http.body.ConcatenatingSubscriber
allowDiscard, complete, disregardBackpressure, emitFinalSeparator, emitLeadingSeparator, error, onBytesConsumed, onComplete, onError, onForward, onNext, onSubscribe, start
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.body.stream.BufferConsumer
complete, discard, error
Methods inherited from interface reactor.core.CoreSubscriber
currentContext
-
Method Details
-
concatenate
-
forward
Description copied from class:ConcatenatingSubscriber
Forward the given body to the shared buffer.- Specified by:
forward
in classConcatenatingSubscriber
- Parameters:
body
- The body- Returns:
- The
BufferConsumer.Upstream
to control component backpressure, ornull
if all bytes were written immediately (as is the case for anAvailableByteBody
)
-
add
-
forwardComplete
protected void forwardComplete()Description copied from class:ConcatenatingSubscriber
Forward completion to the shared buffer.- Specified by:
forwardComplete
in classConcatenatingSubscriber
-
forwardError
Description copied from class:ConcatenatingSubscriber
Forward an error to the shared buffer.- Specified by:
forwardError
in classConcatenatingSubscriber
- Parameters:
t
- The error
-