|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.opmath.mail.ByteArrayDataSource
A DataSource that can act as a DataHandler for an email
MimeBodyPart.
The com.opmath.mail.ByteArrayDataSource class implements the
javax.activation.DataSource interface.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
| Constructor Summary | |
ByteArrayDataSource(byte[] data,
String type)
Constructs a ByteArrayDataSource instance. |
|
ByteArrayDataSource(InputStream inStrm,
String type)
Constructs a ByteArrayDataSource instance. |
|
ByteArrayDataSource(String inStr,
String type)
Constructs a ByteArrayDataSource instance. |
|
| Method Summary | |
String |
getContentType()
Returns the MIME type of this instance's data. |
InputStream |
getInputStream()
Returns a new ByteArrayInputStream, based on this instance's data. |
String |
getName()
Returns the name of the file from which the data dispensed by this ByteArrayDataSource
originated. |
OutputStream |
getOutputStream()
Not supported by this class. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public ByteArrayDataSource(InputStream inStrm,
String type)
throws IOException
ByteArrayDataSource instance. Data will is obtained from
an InputStream. If the InputStream cannot be read, the
constructor will throw an IOException.
inStrm - the InputStream carrying the data.type - the String identifying the MIME type.java.util.IOException - An exception thrown if
the InputStream cannot be read.
public ByteArrayDataSource(byte[] data,
String type)
ByteArrayDataSource instance. Data will is obtained from
a byte[] - in other words, no data transformation takes place.
data - the byte[] carrying the data.type - the String identifying the MIME type.
public ByteArrayDataSource(String inStr,
String type)
throws IOException
ByteArrayDataSource instance. Data will is obtained from
an String. If the String cannot be translated, the
constructor will throw an IOException.
inStr - the String carrying the data.type - the String identifying the MIME type.java.util.IOException - An exception thrown if
the String cannot be translated.| Method Detail |
public InputStream getInputStream()
throws IOException
ByteArrayInputStream, based on this instance's data.
getInputStream in interface DataSourceByteArrayInputStream.java.util.IOException - An exception thrown if
the data is null.
public OutputStream getOutputStream()
throws IOException
getOutputStream in interface DataSourceOutputStream. (Formally only.)java.util.IOException - Always.public String getContentType()
getContentType in interface DataSourceString indicating the MIME type.public String getName()
ByteArrayDataSource
originated. For this class, the file is not identified.
getName in interface DataSourceString equal to "anonymous ByteArrayDataSource instance".
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||