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