public class BlobDataSource extends java.lang.Object implements SizeAwareDataSource
Blob.| Modifier and Type | Field and Description |
|---|---|
private Blob |
blob |
private java.lang.String |
contentType |
| Constructor and Description |
|---|
BlobDataSource(Blob blob,
java.lang.String contentType) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContentType() |
java.io.InputStream |
getInputStream() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream() |
long |
getSize()
Get the size of the data source.
|
private final Blob blob
private final java.lang.String contentType
public BlobDataSource(Blob blob, java.lang.String contentType)
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.lang.String getName()
getName in interface javax.activation.DataSourcepublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic long getSize()
SizeAwareDataSourceDataSource.getInputStream() before reaching
the end of the stream. If the implementation is unable to determine the
size, it must return -1.getSize in interface SizeAwareDataSource