public class ByteArrayDataSource extends Object implements DataSource
String
or an
input stream.Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
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!
|
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 InputStream getInputStream() throws IOException
InputStream
for reading from this data source.getInputStream
in interface DataSource
IOException
public OutputStream getOutputStream() throws IOException
IOException
will
be thrown.getOutputStream
in interface DataSource
IOException
public String getContentType()
getContentType
in interface DataSource
public String getName()
getName
in interface DataSource
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.