簡體   English   中英

是否有可能在javax.mail中獲取未解碼的base64附件數據MimeMessageParser

[英]is it possible to get undecoded base64 attachment data in javax.mail MimeMessageParser

我正在使用javax.mail中的MimeMessageParser / DataSource類解析附件。 傳入的MIME具有base64編碼的附件文件,我需要按原樣進行base64編碼的輸出,但是DataSource.getInputStream()返回解碼的輸出。 因為我必須將base64存儲在應用程序中,所以如果可能的話,我不想再次將其重新編碼為base64。 請讓我知道是否有辦法。

MimeMessageParser mmparser;
mmparser=....
..
for (int i = 0; i < attachmentList.size(); i++) {
DataSource dataSource = attachmentList.get(i);
//dataSource.getInputStream(); this returns decoded stream
// need the base64 encoded stream fromm the original email attachment
}

如果放棄使用MimeMessageParser而是直接使用JavaMail API,則可以使用MimeBodyPart.getRawInputStream提取編碼的數據。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM