|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.mail.util.ByteArrayDataSource
public class ByteArrayDataSource
An activation DataSource object that sources the data from a byte[] array.
Constructor Summary | |
---|---|
ByteArrayDataSource(byte[] data,
String type)
Create a ByteArrayDataSource directly from a byte array. |
|
ByteArrayDataSource(InputStream in,
String type)
Create a ByteArrayDataSource from an input stream. |
|
ByteArrayDataSource(String data,
String type)
Create a ByteArrayDataSource from a string value. |
Method Summary | |
---|---|
String |
getContentType()
Get the MIME content type information for this DataSource. |
InputStream |
getInputStream()
Create an input stream for this data. |
String |
getName()
Retrieve the DataSource name. |
OutputStream |
getOutputStream()
Open an output stream for the DataSource. |
void |
setName(String name)
Set a new DataSource name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteArrayDataSource(InputStream in, String type) throws IOException
in
- The source input stream.type
- The MIME-type of the data.
IOException
public ByteArrayDataSource(byte[] data, String type)
data
- The source byte array (not copied).type
- The content MIME-type.public ByteArrayDataSource(String data, String type) throws IOException
data
- The source data string.type
- The MIME type information.
IOException
Method Detail |
---|
public InputStream getInputStream() throws IOException
getInputStream
in interface DataSource
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface DataSource
IOException
public String getContentType()
getContentType
in interface DataSource
public String getName()
getName
in interface DataSource
public void setName(String name)
name
- The new name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |