|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.util.ByteArrayDataSource
public class ByteArrayDataSource
A DataSource that can be created out of a byte array, a String or an
input stream.
| Constructor Summary | |
|---|---|
ByteArrayDataSource(byte[] data,
String type)
Create a DataSource from a byte array. |
|
ByteArrayDataSource(InputStream is,
String type)
Create a DataSoruce from an input stream. |
|
ByteArrayDataSource(String data,
String type)
Create a DataSource from a String. |
|
| Method Summary | |
|---|---|
String |
getContentType()
Returns the content type for this data source. |
InputStream |
getInputStream()
Returns an InputStream for reading from this data source. |
String |
getName()
Returns the name of the data source. |
OutputStream |
getOutputStream()
This operation is not supported! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArrayDataSource(InputStream is,
String type)
is - InputStream from which the data will be read.type - Mime-Type of the data (e.g., "application/pdf").
public ByteArrayDataSource(byte[] data,
String type)
data - byte array holding the data for this data source. The byte array will
not be copied but used directly.type - Mime-Type of the data (e.g., "application/pdf").
public ByteArrayDataSource(String data,
String type)
String.
data - String holding the data for this data source.type - Mime-Type of the data (e.g., "application/pdf").| Method Detail |
|---|
public InputStream getInputStream()
throws IOException
InputStream for reading from this data source.
getInputStream in interface DataSourceIOException
public OutputStream getOutputStream()
throws IOException
IOException will
be thrown.
getOutputStream in interface DataSourceIOExceptionpublic String getContentType()
getContentType in interface DataSourcepublic String getName()
getName in interface DataSource
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||