| java.lang.Object | |
| ↳ | com.google.code.javax.mail.util.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.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| data | |||||||||||
| len | |||||||||||
| name | |||||||||||
| type | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Create a ByteArrayDataSource with data from the
specified InputStream and with the specified MIME type.
| |||||||||||
Create a ByteArrayDataSource with data from the
specified byte array and with the specified MIME type.
| |||||||||||
Create a ByteArrayDataSource with data from the
specified String and with the specified MIME type.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Get the MIME content type of the data.
| |||||||||||
Return an InputStream for the data.
| |||||||||||
Get the name of the data.
| |||||||||||
Return an OutputStream for the data.
| |||||||||||
Set the name of the data.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.google.code.javax.activation.DataSource
| |||||||||||
Create a ByteArrayDataSource with data from the specified InputStream and with the specified MIME type. The InputStream is read completely and the data is stored in a byte array.
| is | The InputStream |
|---|---|
| type | The MIME type |
| IOException | errors reading the stream |
|---|
Create a ByteArrayDataSource with data from the specified byte array and with the specified MIME type.
| data | The data |
|---|---|
| type | The MIME type |
Create a ByteArrayDataSource with data from the
specified String and with the specified MIME type.
The MIME type should include a charset
parameter specifying the charset to be used for the
string. If the parameter is not included, the
default charset is used.
| data | The String |
|---|---|
| type | The MIME type |
| IOException | errors reading the String |
|---|
Get the MIME content type of the data.
Return an InputStream for the data. Note that a new stream is returned each time this method is called.
| IOException | if no data has been set |
|---|
Get the name of the data. By default, an empty string ("") is returned.
Return an OutputStream for the data.
Writing the data is not supported; an IOException
is always thrown.
| IOException | always |
|---|
Set the name of the data.
| name | The name of this data |
|---|