|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.arsdigita.mail.ByteArrayDataSource
Provides a simple DataSource that allows in-memory data objects to be attached to a mail message.
Based on the sample code distributed with the JavaMail 1.2 API.
| Constructor Summary | |
ByteArrayDataSource(byte[] data,
String type,
String name)
Creates a data source from a byte array. |
|
ByteArrayDataSource(InputStream is,
String type,
String name)
Creates a data source from an input stream. |
|
ByteArrayDataSource(String data,
String type,
String name)
Creates a data source from a String, assuming the data only contains ASCII characters (iso-8859-1). |
|
ByteArrayDataSource(String data,
String type,
String name,
String charset)
Creates a data source from a String using a specified character set. |
|
| Method Summary | |
String |
getContentType()
Returns the MIME type of the content. |
InputStream |
getInputStream()
Returns an input stream for the data. |
String |
getName()
Returns the name of the content. |
OutputStream |
getOutputStream()
Required by the interface, but not available. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ByteArrayDataSource(InputStream is,
String type,
String name)
is - the InputStream to read fromtype - the MIME type of the dataname - the name of the data
public ByteArrayDataSource(byte[] data,
String type,
String name)
data - the byte array containing the datatype - the MIME type of the dataname - the name of the data
public ByteArrayDataSource(String data,
String type,
String name)
data - the String containing the datatype - the MIME type of the dataname - the name of the data
public ByteArrayDataSource(String data,
String type,
String name,
String charset)
data - the String containing the datatype - the MIME type of the dataname - the name of the datacharset - the encoding used for the String| Method Detail |
public InputStream getInputStream()
throws IOException
getInputStream in interface javax.activation.DataSourceIOException
public OutputStream getOutputStream()
throws IOException
getOutputStream in interface javax.activation.DataSourceIOExceptionpublic String getContentType()
getContentType in interface javax.activation.DataSourcepublic String getName()
getName in interface javax.activation.DataSource
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||