public class CmsByteArrayDataSource extends java.lang.Object implements javax.activation.DataSource
Constructor and Description |
---|
CmsByteArrayDataSource(java.lang.String name,
byte[] data,
java.lang.String contentType)
Creates a ByteArrayDataSource with data from the specified byte array and with the specified MIME type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType() |
java.io.InputStream |
getInputStream() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream() |
public CmsByteArrayDataSource(java.lang.String name, byte[] data, java.lang.String contentType)
name
- the name of the datadata
- the datacontentType
- the MIME content type of the datapublic java.lang.String getContentType()
getContentType
in interface javax.activation.DataSource
DataSource.getContentType()
public java.io.InputStream getInputStream()
getInputStream
in interface javax.activation.DataSource
DataSource.getInputStream()
public java.lang.String getName()
getName
in interface javax.activation.DataSource
DataSource.getName()
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface javax.activation.DataSource
java.io.IOException
DataSource.getOutputStream()