public class

ByteArrayDataSource

extends Object
implements DataSource
java.lang.Object
   ↳ com.atlassian.jira.mail.util.ByteArrayDataSource

Class Overview

This is a javax.activation.DataSource that reads input from a stream and captures it into a I18nVal. This is useful for capturing strea data into emails for example.

Summary

Public Constructors
ByteArrayDataSource(InputStream inputStream, String contentType)
Create a datasource from an input stream.
Public Methods
String getContentType()
Get the content type.
InputStream getInputStream()
Get the input stream.
String getName()
Get the name.
OutputStream getOutputStream()
Get the OutputStream to write to
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.activation.DataSource

Public Constructors

public ByteArrayDataSource (InputStream inputStream, String contentType)

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

Public Methods

public String getContentType ()

Get the content type.

Returns
  • A String.

public InputStream getInputStream ()

Get the input stream.

Returns
  • An InputStream.
Throws
IOException

public String getName ()

Get the name.

Returns
  • A String.

public OutputStream getOutputStream ()

Get the OutputStream to write to

Returns
  • An OutputStream
Throws
IOException