Package io.micronaut.http.netty.body
Class NettyByteBody
java.lang.Object
io.micronaut.http.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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @NonNull ExecutionFlow<? extends CloseableAvailableByteBody>Variant ofInternalByteBody.buffer()that uses theExecutionFlowAPI for extra efficiency.Get this body as a reactive stream of byte arrays.Get this body as a reactive stream ofByteBuffers.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, waitMethods inherited from interface io.micronaut.http.body.ByteBody
allowDiscard, expectedLength, move, split, split, toInputStreamMethods inherited from interface io.micronaut.http.body.InternalByteBody
buffer
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
NettyByteBody
public NettyByteBody()
-
-
Method Details
-
toByteBufs
-
toByteArrayPublisher
Description copied from interface:ByteBodyGet 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:
toByteArrayPublisherin interfaceByteBody- Returns:
- The streamed bytes
-
toByteBufferPublisher
Description copied from interface:ByteBodyGet this body as a reactive stream ofByteBuffers. 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:
toByteBufferPublisherin interfaceByteBody- Returns:
- The streamed bytes
-
bufferFlow
Description copied from interface:InternalByteBodyVariant ofInternalByteBody.buffer()that uses theExecutionFlowAPI for extra efficiency.- Specified by:
bufferFlowin interfaceInternalByteBody- Returns:
- A flow that completes when all bytes are available
-