|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.mail.util.ByteArrayDataSource
public class ByteArrayDataSource
An activation DataSource object that sources the data from a byte[] array.
| Constructor Summary | |
|---|---|
ByteArrayDataSource(byte[] data,
java.lang.String type)
Create a ByteArrayDataSource directly from a byte array. |
|
ByteArrayDataSource(java.io.InputStream in,
java.lang.String type)
Create a ByteArrayDataSource from an input stream. |
|
ByteArrayDataSource(java.lang.String data,
java.lang.String type)
Create a ByteArrayDataSource from a string value. |
|
| Method Summary | |
|---|---|
java.lang.String |
getContentType()
Get the MIME content type information for this DataSource. |
java.io.InputStream |
getInputStream()
Create an input stream for this data. |
java.lang.String |
getName()
Retrieve the DataSource name. |
java.io.OutputStream |
getOutputStream()
Open an output stream for the DataSource. |
void |
setName(java.lang.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(java.io.InputStream in,
java.lang.String type)
throws java.io.IOException
in - The source input stream.type - The MIME-type of the data.
java.io.IOException
public ByteArrayDataSource(byte[] data,
java.lang.String type)
data - The source byte array (not copied).type - The content MIME-type.
public ByteArrayDataSource(java.lang.String data,
java.lang.String type)
throws java.io.IOException
data - The source data string.type - The MIME type information.
java.io.IOException| Method Detail |
|---|
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOException
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.lang.String getName()
getName in interface javax.activation.DataSourcepublic void setName(java.lang.String name)
name - The new name.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||