|
|||||||||
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
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.
Constructor Summary | |
---|---|
ByteArrayDataSource(byte[] data,
java.lang.String type)
Create a ByteArrayDataSource with data from the specified byte array and with the specified MIME type. |
|
ByteArrayDataSource(java.io.InputStream is,
java.lang.String type)
Create a ByteArrayDataSource with data from the specified InputStream and with the specified MIME type. |
|
ByteArrayDataSource(java.lang.String data,
java.lang.String type)
Create a ByteArrayDataSource with data from the specified String and with the specified MIME type. |
Method Summary | |
---|---|
java.lang.String |
getContentType()
Get the MIME content type of the data. |
java.io.InputStream |
getInputStream()
Return an InputStream for the data. |
java.lang.String |
getName()
Get the name of the data. |
java.io.OutputStream |
getOutputStream()
Return an OutputStream for the data. |
void |
setName(java.lang.String name)
Set the name of the data. |
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 is, java.lang.String type) throws java.io.IOException
is
- the InputStreamtype
- the MIME type
java.io.IOException
- errors reading the streampublic ByteArrayDataSource(byte[] data, java.lang.String type)
data
- the datatype
- the MIME typepublic ByteArrayDataSource(java.lang.String data, java.lang.String type) throws java.io.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
java.io.IOException
- errors reading the StringMethod Detail |
---|
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface DataSource
java.io.IOException
- if no data has been setpublic java.io.OutputStream getOutputStream() throws java.io.IOException
IOException
is always thrown.
getOutputStream
in interface DataSource
java.io.IOException
- alwayspublic java.lang.String getContentType()
getContentType
in interface DataSource
public java.lang.String getName()
getName
in interface DataSource
public void setName(java.lang.String name)
name
- the name of this data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009, 2010, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 4-June-2010 04:34