Class NettyPartData
- java.lang.Object
-
- io.micronaut.http.server.netty.multipart.NettyPartData
-
- All Implemented Interfaces:
io.micronaut.http.multipart.PartData
@Internal public class NettyPartData extends java.lang.Object implements io.micronaut.http.multipart.PartDataA Netty implementation ofPartData.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description NettyPartData(HttpDataReference httpData, HttpDataReference.Component component)NettyPartData(java.util.function.Supplier<java.util.Optional<io.micronaut.http.MediaType>> mediaTypeSupplier, io.micronaut.core.util.functional.ThrowingSupplier<io.netty.buffer.ByteBuf,java.io.IOException> byteBufSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBufgetByteBuf()java.nio.ByteBuffergetByteBuffer()The contents of the chunk are released immediately.byte[]getBytes()The contents of the chunk are released immediately.java.util.Optional<io.micronaut.http.MediaType>getContentType()java.io.InputStreamgetInputStream()The contents of the chunk will be released when the stream is closed.
-
-
-
Constructor Detail
-
NettyPartData
public NettyPartData(HttpDataReference httpData, HttpDataReference.Component component)
- Parameters:
httpData- The data referencecomponent- The component reference
-
NettyPartData
public NettyPartData(java.util.function.Supplier<java.util.Optional<io.micronaut.http.MediaType>> mediaTypeSupplier, io.micronaut.core.util.functional.ThrowingSupplier<io.netty.buffer.ByteBuf,java.io.IOException> byteBufSupplier)- Parameters:
mediaTypeSupplier- The content type supplierbyteBufSupplier- The byte buffer supplier
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionThe contents of the chunk will be released when the stream is closed.- Specified by:
getInputStreamin interfaceio.micronaut.http.multipart.PartData- Throws:
java.io.IOException- See Also:
PartData.getInputStream()
-
getBytes
public byte[] getBytes() throws java.io.IOExceptionThe contents of the chunk are released immediately.- Specified by:
getBytesin interfaceio.micronaut.http.multipart.PartData- Throws:
java.io.IOException- See Also:
PartData.getBytes()
-
getByteBuffer
public java.nio.ByteBuffer getByteBuffer() throws java.io.IOExceptionThe contents of the chunk are released immediately.- Specified by:
getByteBufferin interfaceio.micronaut.http.multipart.PartData- Throws:
java.io.IOException- See Also:
PartData.getByteBuffer()
-
getContentType
public java.util.Optional<io.micronaut.http.MediaType> getContentType()
- Specified by:
getContentTypein interfaceio.micronaut.http.multipart.PartData- See Also:
PartData.getContentType()
-
getByteBuf
public io.netty.buffer.ByteBuf getByteBuf() throws java.io.IOException- Returns:
- The native netty
ByteBuffor this chunk - Throws:
java.io.IOException- If an error occurs retrieving the buffer
-
-