Class NettyByteBody
java.lang.Object
io.micronaut.http.server.netty.body.NettyByteBody
- All Implemented Interfaces:
ByteBody
,InternalByteBody
- Direct Known Subclasses:
AvailableNettyByteBody
,StreamingNettyByteBody
@Internal
public abstract sealed class NettyByteBody
extends Object
implements ByteBody, InternalByteBody
permits AvailableNettyByteBody, StreamingNettyByteBody
Common base class for streaming and immediate netty ByteBody implementations.
- Since:
- 4.5.0
- Author:
- Jonas Konrad
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.http.body.ByteBody
ByteBody.BodyDiscardedException, ByteBody.SplitBackpressureMode
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<? extends CloseableAvailableByteBody>
buffer()
Buffer the full body and return anCompletableFuture
that will complete when all bytes are available, or an error occurs.abstract @NonNull ExecutionFlow<? extends CloseableAvailableByteBody>
Variant ofByteBody.buffer()
that uses theExecutionFlow
API for extra efficiency.Get this body as a reactive stream of byte arrays.Get this body as a reactive stream ofByteBuffer
s.static reactor.core.publisher.Flux<io.netty.buffer.ByteBuf>
toByteBufs
(ByteBody body) 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.ByteBody
allowDiscard, expectedLength, split, split, toInputStream
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
NettyByteBody
public NettyByteBody()
-
-
Method Details
-
toByteBufs
-
toByteArrayPublisher
Description copied from interface:ByteBody
Get this body as a reactive stream of byte arrays.This is a primary operation. After this operation, no other primary operation or
ByteBody.split()
may be done.- Specified by:
toByteArrayPublisher
in interfaceByteBody
- Returns:
- The streamed bytes
-
toByteBufferPublisher
Description copied from interface:ByteBody
Get this body as a reactive stream ofByteBuffer
s. Note that the buffers may bereference counted
, and the caller must take care of releasing them.This is a primary operation. After this operation, no other primary operation or
ByteBody.split()
may be done.- Specified by:
toByteBufferPublisher
in interfaceByteBody
- Returns:
- The streamed bytes
-
bufferFlow
Description copied from interface:InternalByteBody
Variant ofByteBody.buffer()
that uses theExecutionFlow
API for extra efficiency.- Specified by:
bufferFlow
in interfaceInternalByteBody
- Returns:
- A flow that completes when all bytes are available
-
buffer
Description copied from interface:ByteBody
Buffer the full body and return anCompletableFuture
that will complete when all bytes are available, or an error occurs.This is a primary operation. After this operation, no other primary operation or
ByteBody.split()
may be done.
-