DataSource backed by a byte buffer.
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final String | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | ByteArrayDataSource(byte[]
input buffer - the byte array isn't being copied; used directly buf, String content type contentType)
|
| public | ByteArrayDataSource(byte[]
input buffer - the byte array isn't being copied; used directly buf, int length length, String content type contentType)
|
| Modifier and Type | Method and Description |
|---|---|
| public String | getContentType()
Implements jakarta. This method returns the MIME type of the data in the form of a string. |
| public InputStream | getInputStream()
Implements jakarta. This method returns an |
| public String | getName()
Implements jakarta. Return the name of this object where the name of the object is dependant on the nature of the underlying objects. |
| public OutputStream | getOutputStream()
Implements jakarta. This method returns an |
| buf | back to summary |
|---|---|
| private final byte[] buf | |
| contentType | back to summary |
|---|---|
| private final String contentType | |
| len | back to summary |
|---|---|
| private final int len | |
| ByteArrayDataSource | back to summary |
|---|---|
public ByteArrayDataSource(byte[] buf, String contentType)
| |
| ByteArrayDataSource | back to summary |
|---|---|
public ByteArrayDataSource(byte[] buf, int length, String contentType)
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() Implements jakarta. Doc from jakarta. This method returns the MIME type of the data in the form of a string. It should always return a valid type. It is suggested that getContentType return "application/octet-stream" if the DataSource implementation can not determine the data type.
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() Implements jakarta. Doc from jakarta. This method returns an
| |
| getName | back to summary |
|---|---|
| public String getName() Implements jakarta. Doc from jakarta. Return the name of this object where the name of the object is dependant on the nature of the underlying objects. DataSources encapsulating files may choose to return the filename of the object. (Typically this would be the last component of the filename, not an entire pathname.)
| |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() Implements jakarta. Doc from jakarta. This method returns an
| |