wt.mail
Class ByteArrayDataSource
java.lang.Object
wt.mail.ByteArrayDataSource
- All Implemented Interfaces:
- javax.activation.DataSource
- public class ByteArrayDataSource
- extends Object
- implements javax.activation.DataSource
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
versionID
private static final String versionID
- See Also:
- Constant Field Values
RESOURCE
private static final String RESOURCE
- See Also:
- Constant Field Values
data
private byte[] data
type
private String type
ByteArrayDataSource
public ByteArrayDataSource(String data,
String type,
String charset)
throws UnsupportedEncodingException
- Create a datasource from a String.
- Parameters:
data
- The string containing the datatype
- The content type of the string. Ex. "text/html".charset
- The charset the string uses.
ByteArrayDataSource
public ByteArrayDataSource(String data,
String type)
throws UnsupportedEncodingException
- Create a datasource from a String assumed to be in the ISO-8859-15 charset.
- Parameters:
data
- The string containing the datatype
- The content type of the string. Ex. "text/html".
getInputStream
public InputStream getInputStream()
throws IOException
- Specified by:
getInputStream
in interface javax.activation.DataSource
- Throws:
IOException
getOutputStream
public OutputStream getOutputStream()
throws IOException
- Specified by:
getOutputStream
in interface javax.activation.DataSource
- Throws:
IOException
getContentType
public String getContentType()
- Specified by:
getContentType
in interface javax.activation.DataSource
getName
public String getName()
- Specified by:
getName
in interface javax.activation.DataSource