class PartDataSource extends java.lang.Object implements SizeAwareDataSource
DataSource implementation for MIME parts. This implementation will be used if
there is no DataSource implementation specific to the buffering strategy being used, i.e.
if PartContent.getDataSource(String) returns null.| Constructor and Description |
|---|
PartDataSource(PartImpl part) |
| 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 PartImpl part
public PartDataSource(PartImpl part)
public java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic 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