com.opencms.util
Class CmsByteArrayDataSource
java.lang.Object
|
+--com.opencms.util.CmsByteArrayDataSource
- All Implemented Interfaces:
- javax.activation.DataSource
- public class CmsByteArrayDataSource
- extends Object
- implements javax.activation.DataSource
This class implements a DataSource from an InputStream, a byte array or a
String and is most often used to create a mail message with the CmsMail object.
- Version:
- $Revision: 1.3 $ $Date: 2003/02/08 15:32:14 $
- Author:
- $Author: a.kandzior $
- See Also:
CmsMail,
http://java.sun.com/products/javamail/index.html
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CmsByteArrayDataSource
public CmsByteArrayDataSource(byte[] data,
String type)
CmsByteArrayDataSource
public CmsByteArrayDataSource(InputStream is,
String type)
CmsByteArrayDataSource
public CmsByteArrayDataSource(String data,
String type,
String encoding)
getContentType
public String getContentType()
- Specified by:
getContentType in interface javax.activation.DataSource
getInputStream
public InputStream getInputStream()
throws IOException
- Return an InputStream for the data.
Note - a new stream must be returned each time.
- Specified by:
getInputStream in interface javax.activation.DataSource
IOException
getName
public String getName()
- Specified by:
getName in interface javax.activation.DataSource
getOutputStream
public OutputStream getOutputStream()
throws IOException
- Specified by:
getOutputStream in interface javax.activation.DataSource
IOException