ByteArrayDataSource
instead@Deprecated public class ByteArrayDataSource extends Object implements DataSource
From version 1.3.1, it is possible to set a name for this DataSource, and it is recommended to do so.
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE
Deprecated.
Define the buffer size.
|
Constructor and Description |
---|
ByteArrayDataSource(byte[] data,
String aType)
Deprecated.
Create a datasource from a byte array.
|
ByteArrayDataSource(InputStream aIs,
String aType)
Deprecated.
Create a datasource from an input stream.
|
ByteArrayDataSource(String data,
String aType)
Deprecated.
Create a datasource from a String.
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Deprecated.
Get the content type.
|
InputStream |
getInputStream()
Deprecated.
Get the input stream.
|
String |
getName()
Deprecated.
Get the name.
|
OutputStream |
getOutputStream()
Deprecated.
Get the OutputStream to write to.
|
void |
setName(String name)
Deprecated.
Sets the name for this DataSource.
|
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 DataSource
public InputStream getInputStream() throws IOException
getInputStream
in interface DataSource
IOException
- IOExceptionpublic void setName(String name)
name
- The name.public String getName()
getName
in interface DataSource
public OutputStream getOutputStream()
getOutputStream
in interface DataSource
Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.