public class ByteArrayDataSource extends java.lang.Object implements javax.activation.DataSource
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE
define the buffer size
|
Constructor and Description |
---|
ByteArrayDataSource(byte[] data,
java.lang.String aType)
Create a datasource from a byte array.
|
ByteArrayDataSource(java.io.InputStream aIs,
java.lang.String aType)
Create a datasource from an input stream.
|
ByteArrayDataSource(java.lang.String data,
java.lang.String aType)
Create a datasource from a String.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Get the content type.
|
java.io.InputStream |
getInputStream()
Get the input stream.
|
java.lang.String |
getName()
Get the name.
|
java.io.OutputStream |
getOutputStream()
Get the OutputStream to write to
|
public static final int BUFFER_SIZE
public ByteArrayDataSource(byte[] data, java.lang.String aType) throws java.io.IOException
data
- A byte[].aType
- A String.java.io.IOException
- IOExceptionpublic ByteArrayDataSource(java.io.InputStream aIs, java.lang.String aType) throws java.io.IOException
aIs
- An InputStream.aType
- A String.java.io.IOException
- IOExceptionpublic ByteArrayDataSource(java.lang.String data, java.lang.String aType) throws java.io.IOException
data
- A String.aType
- A String.java.io.IOException
- IOExceptionpublic java.lang.String getContentType()
getContentType
in interface javax.activation.DataSource
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface javax.activation.DataSource
java.io.IOException
- IOExceptionpublic java.lang.String getName()
getName
in interface javax.activation.DataSource
public java.io.OutputStream getOutputStream()
getOutputStream
in interface javax.activation.DataSource