【发布时间】:2012-12-29 12:02:32
【问题描述】:
我使用 javamail 来获取消息,当我收到消息时: com.sun.mail.util.BASE64DecoderStream,
我知道这是多部分消息的一部分,在我拥有的消息来源中
Content-Type: image/png; name=index_01.png
内容传输编码:base64
如何编码这条消息??
编辑: 我有那个代码:
else if (mbp.getContent() instanceof BASE64DecoderStream){
InputStream is = null;
ByteArrayOutputStream os = null;
is = mbp.getInputStream();
os = new ByteArrayOutputStream(512);
int c = 0;
while ((c = is.read()) != -1) {
os.write(c);
}
System.out.println(os.toString());
}
并且该代码返回奇怪的字符串,例如: Ř˙á?Exif??II*????????????˙ě?Ducky???????˙á)
【问题讨论】:
标签: base64 jakarta-mail