Class ByteArrayDataSource

java.lang.Object
com.atlassian.jira.mail.util.ByteArrayDataSource
All Implemented Interfaces:
jakarta.activation.DataSource

public class ByteArrayDataSource extends Object implements jakarta.activation.DataSource
This is a DataSource that reads input from a stream and captures it into a I18nVal. This is useful for capturing strea data into emails for example.
Since:
v3.13.3
  • Constructor Details

    • ByteArrayDataSource

      public ByteArrayDataSource(InputStream inputStream, String contentType) throws IOException
      Create a datasource from an input stream.
      Parameters:
      inputStream - This is NOT closed as a result of this operation
      contentType - The content type of the data
      Throws:
      IOException
  • Method Details

    • getContentType

      public String getContentType()
      Get the content type.
      Specified by:
      getContentType in interface jakarta.activation.DataSource
      Returns:
      A String.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Get the input stream.
      Specified by:
      getInputStream in interface jakarta.activation.DataSource
      Returns:
      An InputStream.
      Throws:
      IOException
    • getName

      public String getName()
      Get the name.
      Specified by:
      getName in interface jakarta.activation.DataSource
      Returns:
      A String.
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Get the OutputStream to write to
      Specified by:
      getOutputStream in interface jakarta.activation.DataSource
      Returns:
      An OutputStream
      Throws:
      IOException