Class NettyPartData
java.lang.Object
io.micronaut.http.server.netty.multipart.NettyPartData
- All Implemented Interfaces:
PartData
A Netty implementation of
PartData
.- Since:
- 1.0
- Author:
- James Kleeh
-
Constructor Summary
ConstructorDescriptionNettyPartData
(Supplier<Optional<MediaType>> mediaTypeSupplier, ThrowingSupplier<io.netty.buffer.ByteBuf, IOException> byteBufSupplier) -
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBuf
The contents of the chunk are released immediately.byte[]
getBytes()
The contents of the chunk are released immediately.Gets the content type of this chunk.The contents of the chunk will be released when the stream is closed.
-
Constructor Details
-
NettyPartData
public NettyPartData(Supplier<Optional<MediaType>> mediaTypeSupplier, ThrowingSupplier<io.netty.buffer.ByteBuf, IOException> byteBufSupplier) - Parameters:
mediaTypeSupplier
- The content type supplierbyteBufSupplier
- The byte buffer supplier
-
-
Method Details
-
getInputStream
The contents of the chunk will be released when the stream is closed.- Specified by:
getInputStream
in interfacePartData
- Returns:
- The content of this chunk as an
InputStream
- Throws:
IOException
- If an error occurs in retrieving the content- See Also:
-
getBytes
The contents of the chunk are released immediately.- Specified by:
getBytes
in interfacePartData
- Returns:
- The content of this chunk as a
byte[]
- Throws:
IOException
- If an error occurs in retrieving the content- See Also:
-
getByteBuffer
The contents of the chunk are released immediately.- Specified by:
getByteBuffer
in interfacePartData
- Returns:
- The content of this chunk as a
ByteBuffer
- Throws:
IOException
- If an error occurs in retrieving the content- See Also:
-
getContentType
Description copied from interface:PartData
Gets the content type of this chunk.- Specified by:
getContentType
in interfacePartData
- Returns:
- The content type of this chunk.
- See Also:
-
getByteBuf
- Returns:
- The native netty
ByteBuf
for this chunk - Throws:
IOException
- If an error occurs retrieving the buffer
-