public class ByteArrayDataSource
extends java.lang.Object
implements javax.activation.DataSource
| Constructor and Description |
|---|
ByteArrayDataSource(byte[] data,
java.lang.String mimeType)
Create the DataSource.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContentType()
Return the content type of this data.
|
java.io.InputStream |
getInputStream()
Return an InputStream for the data.
|
java.lang.String |
getName()
Return empty string.
|
java.io.OutputStream |
getOutputStream()
Return an OutputStream for the data to be written.
|
public ByteArrayDataSource(byte[] data,
java.lang.String mimeType)
data - The data (duh)mimeType - The mime type of the data (text/html, application/octet-stream, etc.)public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic 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.DataSource