tobe
would you mind sharing your DataSource code as well as the code that creates the
mimebodypart?
I've started going down that road as well and did the datasource implementation but it
looks like it only works when the input
stream is a ByteArrayInputStream.
Thanks.
public class MyStreamSource {
protected InputStream theSourceIS = null;
public MyStreamSource (InputStream is ) {
theSourceIS = is ;
}
public InputStream getInputStream() {
return theSourceIS ; >>--->> java mail doesn't seem to read the stream
and always send an empty body
// this way works if i turn the inputstream into a bytearrayinputstream
ByteArrayOutputStream bos = new ByteArrayOutputStream(
StreamCopy.copy(is , bos);
return new ByteArrayInputStream( bos.toByteArray) ;
}
}
-----Original Message-----
From: tobe [mailto:[EMAIL PROTECTED]
Sent: Mon 5/31/2004 2:16 PM
To: James Users List
Cc:
Subject: Re: StreamBased DataSource instead of byte[] ?
Ian Huynh wrote:
>we want to be able to send and receive emails with very large multipart
>mime (400 Meg or larger)
>email messages (Customer requirements). And it looks like the only way
>to do that
>(via mimebodypart) is to implement data source since MimeBodyPart only
>supports creation via byte[] array
>but not stream.
>
>
>
I had to implement DataSource recently and it turned out not to be so
difficult, all you really need is to provide an implementation for
getInputStream(). BTW, I used Sun's implementation of JavaMail. Don't
know what happens after I set my DataSource to the MimeBodyPart, though.
/tobe
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]