public class ByteArrayDataSource
extends java.lang.Object
implements javax.activation.DataSource
Description: This class implements a typed DataSource from:
- an InputStream
- a byte array
- a String
Title:首亨软件 - TSS/CRM等
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
BUFFER_SIZE
define the buffer size
|
| 构造器和说明 |
|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 javax.activation.DataSourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream 在接口中 javax.activation.DataSourcejava.io.IOException - IOExceptionpublic java.lang.String getName()
getName 在接口中 javax.activation.DataSourcepublic java.io.OutputStream getOutputStream()
getOutputStream 在接口中 javax.activation.DataSource