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

[iaik-jce] SMimeBodyPart problem


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
   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