Constructor and Description |
---|
NettyPartData(HttpDataReference httpData,
HttpDataReference.Component component) |
NettyPartData(java.util.function.Supplier<java.util.Optional<MediaType>> mediaTypeSupplier,
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<MediaType> |
getContentType()
Gets the content type of this chunk.
|
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<MediaType>> mediaTypeSupplier, 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 PartData
java.io.IOException
- If an error occurs in retrieving the contentPartData.getInputStream()
public byte[] getBytes() throws java.io.IOException
getBytes
in interface PartData
java.io.IOException
- If an error occurs in retrieving the contentPartData.getBytes()
public java.nio.ByteBuffer getByteBuffer() throws java.io.IOException
getByteBuffer
in interface PartData
java.io.IOException
- If an error occurs in retrieving the contentPartData.getByteBuffer()
public java.util.Optional<MediaType> getContentType()
PartData
getContentType
in interface PartData
PartData.getContentType()
public io.netty.buffer.ByteBuf getByteBuf() throws java.io.IOException
ByteBuf
for this chunkjava.io.IOException
- If an error occurs retrieving the buffer