javax.activation
Interface DataContentHandler


public interface DataContentHandler

Provider that can convert streams to objects and vice versa.


Method Summary
 java.lang.Object getContent(DataSource ds)
          Returns an object representing the data in its most preferred form.
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df, DataSource ds)
          Returns an object representing the data to be transferred.
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          Returns a list of the flavors that data can be provided in, ordered by preference.
 void writeTo(java.lang.Object obj, java.lang.String mimeType, java.io.OutputStream os)
          Writes the object as a stream of bytes.
 

Method Detail

getTransferDataFlavors

java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns a list of the flavors that data can be provided in, ordered by preference.


getTransferData

java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df,
                                 DataSource ds)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Returns an object representing the data to be transferred.

Parameters:
df - the flavor representing the requested type
ds - the data source of the data to be converted
Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException

getContent

java.lang.Object getContent(DataSource ds)
                            throws java.io.IOException
Returns an object representing the data in its most preferred form.

Parameters:
ds - the data source of the data to be converted
Throws:
java.io.IOException

writeTo

void writeTo(java.lang.Object obj,
             java.lang.String mimeType,
             java.io.OutputStream os)
             throws java.io.IOException
Writes the object as a stream of bytes.

Parameters:
obj - the object to convert
mimeType - the MIME type of the stream
os - the byte stream
Throws:
java.io.IOException