public class EmptyDataSource extends Object implements SizeAwareDataSource
| Modifier and Type | Field and Description |
|---|---|
static EmptyDataSource |
INSTANCE
Empty data source instance with content type application/octet-stream.
|
| Constructor and Description |
|---|
EmptyDataSource(String contentType)
Construct an empty data source with the given content type.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType() |
InputStream |
getInputStream() |
String |
getName() |
OutputStream |
getOutputStream() |
long |
getSize()
Get the size of the data source.
|
public static final EmptyDataSource INSTANCE
public EmptyDataSource(String contentType)
contentType - the content typepublic String getContentType()
getContentType in interface javax.activation.DataSourcepublic String getName()
getName in interface javax.activation.DataSourcepublic 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 SizeAwareDataSourcepublic InputStream getInputStream() throws IOException
getInputStream in interface javax.activation.DataSourceIOExceptionpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface javax.activation.DataSourceIOExceptionCopyright © The Apache Software Foundation. All Rights Reserved.