|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.mail.util.ByteArrayDataSource
public class ByteArrayDataSource
A DataSource backed by a byte array. The byte array may be passed in directly, or may be initialized from an InputStream or a String.
| 构造方法摘要 | |
|---|---|
ByteArrayDataSource(byte[] data,
String type)
Create a ByteArrayDataSource with data from the specified byte array and with the specified MIME type. |
|
ByteArrayDataSource(InputStream is,
String type)
Create a ByteArrayDataSource with data from the specified InputStream and with the specified MIME type. |
|
ByteArrayDataSource(String data,
String type)
Create a ByteArrayDataSource with data from the specified String and with the specified MIME type. |
|
| 方法摘要 | |
|---|---|
String |
getContentType()
Get the MIME content type of the data. |
InputStream |
getInputStream()
Return an InputStream for the data. |
String |
getName()
Get the name of the data. |
OutputStream |
getOutputStream()
Return an OutputStream for the data. |
void |
setName(String name)
Set the name of the data. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public ByteArrayDataSource(InputStream is,
String type)
throws IOException
is - the InputStreamtype - the MIME type
IOException - errors reading the stream
public ByteArrayDataSource(byte[] data,
String type)
data - the datatype - the MIME type
public ByteArrayDataSource(String data,
String type)
throws IOException
charset
parameter specifying the charset to be used for the
string. If the parameter is not included, the
default charset is used.
data - the Stringtype - the MIME type
IOException - errors reading the String| 方法详细信息 |
|---|
public InputStream getInputStream()
throws IOException
DataSource 中的 getInputStreamIOException - if no data has been set
public OutputStream getOutputStream()
throws IOException
IOException
is always thrown.
DataSource 中的 getOutputStreamIOException - alwayspublic String getContentType()
DataSource 中的 getContentTypepublic String getName()
DataSource 中的 getNamepublic void setName(String name)
name - the name of this data
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||