@Internal
public class NettyPartData
extends java.lang.Object
implements io.micronaut.http.multipart.PartData
PartData.| Constructor and 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) |
| Modifier and Type | Method and Description |
|---|---|
io.netty.buffer.ByteBuf |
getByteBuf() |
java.nio.ByteBuffer |
getByteBuffer()
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.InputStream |
getInputStream()
The contents of the chunk will be released when the stream is closed.
|
public NettyPartData(HttpDataReference httpData, HttpDataReference.Component component)
httpData - The data referencecomponent - The component referencepublic 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)
mediaTypeSupplier - The content type supplierbyteBufSupplier - The byte buffer supplierpublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface io.micronaut.http.multipart.PartDatajava.io.IOExceptionPartData.getInputStream()public byte[] getBytes()
throws java.io.IOException
getBytes in interface io.micronaut.http.multipart.PartDatajava.io.IOExceptionPartData.getBytes()public java.nio.ByteBuffer getByteBuffer()
throws java.io.IOException
getByteBuffer in interface io.micronaut.http.multipart.PartDatajava.io.IOExceptionPartData.getByteBuffer()public java.util.Optional<io.micronaut.http.MediaType> getContentType()
getContentType in interface io.micronaut.http.multipart.PartDataPartData.getContentType()public io.netty.buffer.ByteBuf getByteBuf()
throws java.io.IOException
ByteBuf for this chunkjava.io.IOException - If an error occurs retrieving the buffer