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 Object implements io.micronaut.http.multipart.PartData
A Netty implementation of PartData.
Since:
1.0
  • Constructor Details

    • NettyPartData

      public NettyPartData(Supplier<Optional<io.micronaut.http.MediaType>> mediaTypeSupplier, io.micronaut.core.util.functional.ThrowingSupplier<io.netty.buffer.ByteBuf,IOException> byteBufSupplier)
      Parameters:
      mediaTypeSupplier - The content type supplier
      byteBufSupplier - The byte buffer supplier
  • Method Details

    • getInputStream

      public InputStream getInputStream() throws IOException
      The contents of the chunk will be released when the stream is closed.
      Specified by:
      getInputStream in interface io.micronaut.http.multipart.PartData
      Throws:
      IOException
      See Also:
      • PartData.getInputStream()
    • getBytes

      public byte[] getBytes() throws IOException
      The contents of the chunk are released immediately.
      Specified by:
      getBytes in interface io.micronaut.http.multipart.PartData
      Throws:
      IOException
      See Also:
      • PartData.getBytes()
    • getByteBuffer

      public ByteBuffer getByteBuffer() throws IOException
      The contents of the chunk are released immediately.
      Specified by:
      getByteBuffer in interface io.micronaut.http.multipart.PartData
      Throws:
      IOException
      See Also:
      • PartData.getByteBuffer()
    • getContentType

      public Optional<io.micronaut.http.MediaType> getContentType()
      Specified by:
      getContentType in interface io.micronaut.http.multipart.PartData
      See Also:
      • PartData.getContentType()
    • getByteBuf

      public io.netty.buffer.ByteBuf getByteBuf() throws IOException
      Returns:
      The native netty ByteBuf for this chunk
      Throws:
      IOException - If an error occurs retrieving the buffer