Direct way to get an InputStream into the content?
1 posts in topic
Flat View  Flat View

Posted By:   James_Preston
Posted On:   Friday, May 25, 2001 05:47 PM

I'm sending an email. I have an InputStream. I want that InputStream to be the content of the email. Is there any way to get that done directly, or do I have to read the InputStream into a String and then hand that String over to the setText (or setContent) of the Message object? The two-parameter version of setContent takes any Object as the first parameter, what would happen if I passed the InputStream into there with "text/plain" as the type? I would assume that setContent just turns around and calls the toString method of the object, which obviously wouldn't give me what I want. But if it actually looks at what the object is, and then appropriately gets the content of something like an InputStream, that'd be great.

Re: Direct way to get an InputStream into the content?

Posted By:   John_Zukowski  
Posted On:   Saturday, May 26, 2001 07:34 AM

As already mentioned in the FAQ, the MimeMessage class has a constructor that accepts an InputStream.
About | Sitemap | Contact