Class PartData

java.lang.Object
io.micronaut.http.multipart.PartData
All Implemented Interfaces:
Closeable, AutoCloseable

public final class PartData extends Object implements Closeable
Represents a chunk of data belonging to a part of a multipart request.
Since:
1.0
Author:
James Kleeh
  • Constructor Details

    • PartData

      public PartData(FormFieldMetadata fieldMetadata, ReadBuffer readBuffer)
      Parameters:
      fieldMetadata - The field metadata (name, file name, etc.)
      readBuffer - The buffered part data
  • Method Details

    • getInputStream

      public InputStream getInputStream()
      Gets the content of this chunk as an InputStream.
      Returns:
      The content of this chunk as an InputStream
    • getBytes

      public byte[] getBytes()
      Gets the content of this chunk as a byte[].
      Returns:
      The content of this chunk as a byte[]
    • getByteBuffer

      public ByteBuffer getByteBuffer()
      Gets the content of this chunk as a ByteBuffer.
      Returns:
      The content of this chunk as a ByteBuffer
    • getContentType

      public Optional<MediaType> getContentType()
      Gets the content type of this chunk.
      Returns:
      The content type of this chunk.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • fieldMetadata

      public FormFieldMetadata fieldMetadata()
      The field metadata (name, file name, etc.).
      Returns:
      The field metadata
    • readBuffer

      public ReadBuffer readBuffer()
      The field bytes.
      Returns:
      The field bytes
    • toString

      public String toString()
      Overrides:
      toString in class Object