Class AvailableNettyByteBody
- All Implemented Interfaces:
AvailableByteBody,ByteBody,CloseableAvailableByteBody,CloseableByteBody,Closeable,AutoCloseable
- 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 -
Constructor Summary
ConstructorsConstructorDescriptionAvailableNettyByteBody(@NonNull io.netty.buffer.ByteBuf buffer) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescription@NonNull ExecutionFlow<? extends CloseableAvailableByteBody>Deprecated, for removal: This API element is subject to removal in a future version.Variant ofInternalByteBody.buffer()that uses theExecutionFlowAPI for extra efficiency.voidclose()Deprecated, for removal: This API element is subject to removal in a future version.Clean up any resources held by this instance.static @NonNull CloseableByteBodycreateChecked(@NonNull io.netty.channel.EventLoop loop, @NonNull BodySizeLimits bodySizeLimits, @NonNull io.netty.buffer.ByteBuf buf) Deprecated, for removal: This API element is subject to removal in a future version.This is a wrapper aroundAvailableNettyByteBody(ByteBuf)with an extra body length check.static CloseableAvailableByteBodyempty()Deprecated, for removal: This API element is subject to removal in a future version.longlength()Deprecated, for removal: This API element is subject to removal in a future version.The length in bytes of the body.move()Deprecated, for removal: This API element is subject to removal in a future version.Create a newCloseableByteBodywith the same content but an independent lifecycle, claiming this body in the process.io.netty.buffer.ByteBufpeek()Deprecated, for removal: This API element is subject to removal in a future version.split()Deprecated, for removal: This API element is subject to removal in a future version.For immediate buffers, backpressure is not relevant, so the backpressure modes passed toAvailableByteBody.split(SplitBackpressureMode)are ignored.byte @NonNull []Deprecated, for removal: This API element is subject to removal in a future version.Get this body as a byte array.static @NonNull io.netty.buffer.ByteBufDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Get this body as aByteBuffer.Deprecated, for removal: This API element is subject to removal in a future version.Get this body as anInputStream.Deprecated, for removal: This API element is subject to removal in a future version.Get this body as a reactive stream ofReadBuffers.Deprecated, for removal: This API element is subject to removal in a future version.Convert this body to a string with the given charset.voidtouch()Deprecated, for removal: This API element is subject to removal in a future version.Debug trace for leak detection.Methods inherited from class io.micronaut.http.body.InternalByteBody
buffer, bufferFlow, failClaim, recordClosed, recordPrimaryOp, toByteArrayPublisherMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.body.AvailableByteBody
expectedLength, split, toByteArrayPublisher, toByteBufferPublisher, toReadBufferMethods inherited from interface io.micronaut.http.body.CloseableAvailableByteBody
allowDiscard
-
Constructor Details
-
AvailableNettyByteBody
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
empty
Deprecated, for removal: This API element is subject to removal in a future version. -
toByteBuf
@NonNull public static @NonNull io.netty.buffer.ByteBuf toByteBuf(@NonNull @NonNull AvailableByteBody body) Deprecated, for removal: This API element is subject to removal in a future version. -
createChecked
@NonNull public static @NonNull CloseableByteBody createChecked(@NonNull @NonNull io.netty.channel.EventLoop loop, @NonNull @NonNull BodySizeLimits bodySizeLimits, @NonNull @NonNull io.netty.buffer.ByteBuf buf) Deprecated, for removal: This API element is subject to removal in a future version.This is a wrapper aroundAvailableNettyByteBody(ByteBuf)with an extra body length check.- Parameters:
loop- The event loop for constructingStreamingNettyByteBodybodySizeLimits- The body size limits to checkbuf- The input buffer- Returns:
- The body with the given input buffer, or a
StreamingNettyByteBodywith the appropriate content length error
-
peek
public io.netty.buffer.ByteBuf peek()Deprecated, for removal: This API element is subject to removal in a future version. -
toInputStream
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ByteBodyGet this body as anInputStream.This is a primary operation. After this operation, no other primary operation or
ByteBody.split()may be done.- Specified by:
toInputStreamin interfaceAvailableByteBody- Specified by:
toInputStreamin interfaceByteBody- Returns:
- The streamed bytes
-
length
public long length()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AvailableByteBodyThe length in bytes of the body.- Specified by:
lengthin interfaceAvailableByteBody- Returns:
- The length
- See Also:
-
bufferFlow
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:InternalByteBodyVariant ofInternalByteBody.buffer()that uses theExecutionFlowAPI for extra efficiency.- Specified by:
bufferFlowin classInternalByteBody- Returns:
- A flow that completes when all bytes are available
-
close
public void close()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:CloseableByteBodyClean up any resources held by this instance. See class documentation.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceCloseableByteBody
-
toReadBufferPublisher
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ByteBodyGet this body as a reactive stream ofReadBuffers. Note that the caller must take care to release the returned buffers.This is a primary operation. After this operation, no other primary operation or
ByteBody.split()may be done.- Specified by:
toReadBufferPublisherin interfaceAvailableByteBody- Specified by:
toReadBufferPublisherin interfaceByteBody- Specified by:
toReadBufferPublisherin classInternalByteBody- Returns:
- The streamed bytes
-
toByteArray
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AvailableByteBodyGet this body as a byte array.This is a primary operation. After this operation, no other primary operation or
AvailableByteBody.split()may be done.- Specified by:
toByteArrayin interfaceAvailableByteBody- Returns:
- The bytes
-
toByteBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AvailableByteBodyGet this body as aByteBuffer. Note that the buffer may bereference counted, and the caller must take care of releasing it.This is a primary operation. After this operation, no other primary operation or
AvailableByteBody.split()may be done.- Specified by:
toByteBufferin interfaceAvailableByteBody- Returns:
- The bytes
-
move
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ByteBodyCreate a newCloseableByteBodywith the same content but an independent lifecycle, claiming this body in the process.This is a primary operation. After this operation, no other primary operation or
ByteBody.split()may be done.The purpose of this method is to move the data to a different component in an application, making clear that the receiving component claims ownership of the body. If the sending component then closes the original
ByteBodyfor example, it will have no impact on the newCloseableByteBodythat the receiver is working with.- Specified by:
movein interfaceByteBody- Returns:
- A new
CloseableByteBodywith the same content.
-
toString
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AvailableByteBodyConvert this body to a string with the given charset.This is a primary operation. After this operation, no other primary operation or
AvailableByteBody.split()may be done.- Specified by:
toStringin interfaceAvailableByteBody- Parameters:
charset- The charset to convert the body- Returns:
- The body as a string
-
split
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:AvailableByteBodyFor immediate buffers, backpressure is not relevant, so the backpressure modes passed toAvailableByteBody.split(SplitBackpressureMode)are ignored. You can use this method always.- Specified by:
splitin interfaceAvailableByteBody- Specified by:
splitin interfaceByteBody- Returns:
- A body with the same content as this one
- See Also:
-
touch
public void touch()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ByteBodyDebug trace for leak detection.
-
NettyByteBodyFactory