Constructor and Description |
---|
NettyPartData(HttpDataReference httpData,
HttpDataReference.Component component) |
NettyPartData(Supplier<Optional<MediaType>> mediaTypeSupplier,
ThrowingSupplier<io.netty.buffer.ByteBuf,IOException> byteBufSupplier) |
Modifier and Type | Method and Description |
---|---|
io.netty.buffer.ByteBuf |
getByteBuf() |
ByteBuffer |
getByteBuffer()
The contents of the chunk are released immediately.
|
byte[] |
getBytes()
The contents of the chunk are released immediately.
|
Optional<MediaType> |
getContentType()
Gets the content type of this chunk.
|
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(Supplier<Optional<MediaType>> mediaTypeSupplier, ThrowingSupplier<io.netty.buffer.ByteBuf,IOException> byteBufSupplier)
mediaTypeSupplier
- The content type supplierbyteBufSupplier
- The byte buffer supplierpublic InputStream getInputStream() throws IOException
getInputStream
in interface PartData
IOException
- If an error occurs in retrieving the contentPartData.getInputStream()
public byte[] getBytes() throws IOException
getBytes
in interface PartData
IOException
- If an error occurs in retrieving the contentPartData.getBytes()
public ByteBuffer getByteBuffer() throws IOException
getByteBuffer
in interface PartData
IOException
- If an error occurs in retrieving the contentPartData.getByteBuffer()
public Optional<MediaType> getContentType()
PartData
getContentType
in interface PartData
PartData.getContentType()
public io.netty.buffer.ByteBuf getByteBuf() throws IOException
ByteBuf
for this chunkIOException
- If an error occurs retrieving the buffer