Package com.atlassian.jira.mail.util
Class ByteArrayDataSource
java.lang.Object
com.atlassian.jira.mail.util.ByteArrayDataSource
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionByteArrayDataSource(InputStream inputStream, String contentType) Create a datasource from an input stream. -
Method Summary
Modifier and TypeMethodDescriptionGet the content type.Get the input stream.getName()Get the name.Get the OutputStream to write to
-
Constructor Details
-
ByteArrayDataSource
Create a datasource from an input stream.- Parameters:
inputStream- This is NOT closed as a result of this operationcontentType- The content type of the data- Throws:
IOException
-
-
Method Details
-
getContentType
Get the content type.- Specified by:
getContentTypein interfacejakarta.activation.DataSource- Returns:
- A String.
-
getInputStream
Get the input stream.- Specified by:
getInputStreamin interfacejakarta.activation.DataSource- Returns:
- An InputStream.
- Throws:
IOException
-
getName
Get the name.- Specified by:
getNamein interfacejakarta.activation.DataSource- Returns:
- A String.
-
getOutputStream
Get the OutputStream to write to- Specified by:
getOutputStreamin interfacejakarta.activation.DataSource- Returns:
- An OutputStream
- Throws:
IOException
-