Activation Framework: DataHandler from Byte Source?
posted 12 years ago
Hi, I have a program which frequently creates attachments for sending. Currently this involves converting a byte into a file (using a ByteArrayOutputStream) and then converting the file to a DataHandler. Is there any easier way? I've seen a few references to a 'ByteArrayDataSource' from which one can directly construct the DataHandler, however I can't find any documentation regarding this class. I guess it's not a part of the official activation framework. Anyone have any suggestions for a more efficient method than the whole process of writing->attaching->sending->deleting lots of files?