public final class MessageDataSource
extends java.lang.Object
implements javax.activation.DataSource
MessageDataSource - Allows creation of a data source by either an input stream, a string or a byte array.| Constructor and Description |
|---|
MessageDataSource(byte[] data,
java.lang.String contentType)
Create a data source from a byte array
|
MessageDataSource(java.io.InputStream inputStream,
ContentType contentType)
Create a data source from an input stream
|
MessageDataSource(java.io.InputStream inputStream,
ContentType contentType,
java.lang.String name)
Create a data source from an input stream
|
MessageDataSource(java.io.InputStream inputStream,
java.lang.String contentType)
Create a data source from an input stream
|
MessageDataSource(java.io.InputStream inputStream,
java.lang.String contentType,
java.lang.String name)
Create a data source from an input stream
|
MessageDataSource(java.lang.String data,
ContentType contentType)
Create a data source from a String
|
MessageDataSource(java.lang.String data,
java.lang.String contentType)
Create a data source from a String
|
| Modifier and Type | Method and Description |
|---|---|
java.io.ByteArrayInputStream |
getByteArrayInputStream()
Gets the
ByteArrayInputStream. |
java.lang.String |
getContentType() |
byte[] |
getData()
Gets the data
|
java.io.InputStream |
getInputStream() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream()
Not implemented
|
void |
setContentType(java.lang.String contentType)
Sets the contentType
|
public MessageDataSource(java.io.InputStream inputStream,
java.lang.String contentType)
throws java.io.IOException
java.io.IOExceptionpublic MessageDataSource(java.io.InputStream inputStream,
ContentType contentType)
throws java.io.IOException
java.io.IOExceptionpublic MessageDataSource(java.io.InputStream inputStream,
java.lang.String contentType,
java.lang.String name)
throws java.io.IOException
java.io.IOExceptionpublic MessageDataSource(java.io.InputStream inputStream,
ContentType contentType,
java.lang.String name)
throws java.io.IOException
java.io.IOExceptionpublic MessageDataSource(byte[] data,
java.lang.String contentType)
public MessageDataSource(java.lang.String data,
java.lang.String contentType)
throws java.io.UnsupportedEncodingException,
com.openexchange.exception.OXException
java.io.UnsupportedEncodingExceptioncom.openexchange.exception.OXExceptionpublic MessageDataSource(java.lang.String data,
ContentType contentType)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic java.io.ByteArrayInputStream getByteArrayInputStream()
throws java.io.IOException
ByteArrayInputStream.ByteArrayInputStream.java.io.IOException - If an I/O error occurspublic byte[] getData()
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic void setContentType(java.lang.String contentType)
contentType - The contentType to setpublic java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.lang.String getName()
getName in interface javax.activation.DataSource