Problem getting message size
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alon_Avitzur
Posted On:   Tuesday, February 12, 2002 10:02 PM

Hello all! I have a problem that my MimeMessage object always returning -1 when I call the getSize method. The mime message was created only with a session (and not with an input stream), and then data was added to it.When I call the get size on that object, I get -1, even if I call the getContent (which is a multipart), and then call getSize on the body parts, I get -1 as well. How else can I determine the size of the message? I know I can use the writeTo method to a byte array, and then find out the size of that array, but it's not good for me because the writeTo method is to slow for us. I even tried to get the input stream and call the available but it didn't work (the class is PipedInputStream, and it always re   More>>

Hello all!
I have a problem that my MimeMessage object always returning -1 when I call the getSize method.
The mime message was created only with a session (and not with an input stream), and then data was added to it.When I call the get size on that object, I get -1, even if I call the getContent (which is a multipart), and then call getSize on the body parts, I get -1 as well.

How else can I determine the size of the message?

I know I can use the writeTo method to a byte array, and then find out the size of that array, but it's not good for me because the writeTo method is to slow for us.
I even tried to get the input stream and call the available but it didn't work (the class is PipedInputStream, and it always return 1024).

Any help?

Thanks in advance, Alon

   <<Less
About | Sitemap | Contact