[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [iaik-jce] SMimeBodyPart problem



Hello,

SMimeBodyPart does not override method getSize. When using the
SMimeBodyPart(InternetHeaders headers, byte[] content) constructor
SMimeBodyPart does nothing else then calling the corresponding constructor
of the parent MimeBodyPart class. So any problems occuring when calling
getSize() are due to class MimeBodyPart (please note that getSize() of
MimeBodyPart of JavaMail versions < 1.2 returned -1 anytime).

Regards,
Dieter Bratko

-----Urspr?ngliche Nachricht-----
Von: iaik-jce-owner@iaik.tu-graz.ac.at
[mailto:iaik-jce-owner@iaik.tu-graz.ac.at]Im Auftrag von Tataroz T.
Gesendet: Dienstag, 27. M?rz 2001 04:38
An: iaik-jce@iaik.tu-graz.ac.at
Betreff: [iaik-jce] SMimeBodyPart problem


Hello.

I am using this constructor.
SMimeBodyPart(javax.mail.internet.InternetHeaders headers, byte[] content);
The problem is whole bytes of 'content' are gone after call constructor
but it can return right size of the 'content' when use function getSize().
Please help with some example or some explain. Thank you.

Tataroz T.

This is a part of my code :

Object o = myBodyPart.getContent();
if(o instanceof InputStream) {
   InputStream is = (InputStream)o;
   int size = myBodyPart.getSize();
   byte[] buf = new byte[size];
   int buf_size = is.read(buf);

   MimeBodyPart sbp = new SMimeBodyPart(myInternetHeader,buf);
   int sbp_size = sbp.getSize();
   System.out.println("** sbp_size = "+sbp_size);// print 295 (actual file
size)
   is = sbp.getInputStream();
   buf_size = is.read(buf);
   System.out.println("** buf_size = "+buf_size);// print -1 WHY?
}


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--
Mailinglist-archive at
http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content:
UNSUBSCRIBE iaik-jce




smime.p7s