public interface DataContentHandler
DataContentHandlers
框架可以扩展,将流对象,并将对象写入流。
应用程序通常不直接调用方法datacontenthandlers。相反,应用程序调用DataHandler的等效方法。该javax.activation.Datahandler将试图找到一个合适的datacontenthandler对应使用当前datacontenthandlerfactory的MIME类型。然后调用的javax.activation.Datahandler通过在datacontenthandler方法。
Modifier and Type | Method and Description |
---|---|
Object |
getContent(DataSource ds)
返回一个表示数据的对象,以其最优先的形式。
|
Object |
getTransferData(DataFlavor df, DataSource ds)
返回一个表示要传输的数据的对象。
|
DataFlavor[] |
getTransferDataFlavors()
返回dataflavor对象表示的数据可以提供在香料数组。
|
void |
writeTo(Object obj, String mimeType, OutputStream os)
将对象转换为指定MIME类型的字节流,并将其写入输出流。
|
DataFlavor[] getTransferDataFlavors()
Object getTransferData(DataFlavor df, DataSource ds) throws UnsupportedFlavorException, IOException
df
代表请求类型的dataflavor。
ds
代表要转换的数据的数据源。
UnsupportedFlavorException
-如果处理器不支持请求的味道
IOException
-如果数据不能被访问
Object getContent(DataSource ds) throws IOException
getTransferDataFlavors
方法返回。
ds
代表要转换的数据的数据源。
IOException
-如果数据不能被访问
void writeTo(Object obj, String mimeType, OutputStream os) throws IOException
obj
-要转换的对象。
mimeType
-请求的MIME类型的字节流。
os
-输出流的字节流写入转换。
IOException
错误写入流
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.