Does Java has any standard mechanism for uudecoding?

牧云@^-^@ 提交于 2019-12-10 18:00:15

问题


I was writing a Java program to download attachments from POP3 email. Originally I do this with getting an input stream of a MimePart if its content type is validated. And then I can simply write the input stream into a local file through a FileOutputStream.

However, one thing I encountered is that, after I received an email with an attached file as its only content and access it, the mail (of type Message) only consists of a single part, which is of type text/plain. And its content consists of massive random-looking character.

After searching through the internet I found that the file is uuencoded. Then I tried to find if there is any standard library for decoding it but seems I ran out of luck. So I would like to know is there any standard/ usual ways to decode it and obtain the attached file? Thanks a lot.


回答1:


Yes, the "Java(TM) EE 7 Specification APIs" supports encoding and decoding with uuencode.

See MimeUtility.decode():

In addition, "uuencode" is also supported.



来源:https://stackoverflow.com/questions/24558511/does-java-has-any-standard-mechanism-for-uudecoding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!