本文整理了Java中javax.mail.internet.MimeMultipart.readTillFirstBoundary()
方法的一些代码示例,展示了MimeMultipart.readTillFirstBoundary()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeMultipart.readTillFirstBoundary()
方法的具体详情如下:
包路径:javax.mail.internet.MimeMultipart
类名称:MimeMultipart
方法名:readTillFirstBoundary
[英]Move the read pointer to the begining of the first part read till the end of first boundary. Any data read before this point are saved as the preamble.
[中]将读取指针移到读取的第一部分的起点,直到第一个边界的终点。在此点之前读取的任何数据都将保存为序言。
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec
protected void parse() throws MessagingException {
if (parsed) {
return;
}
try {
ContentType cType = new ContentType(contentType);
byte[] boundary = ("--" + cType.getParameter("boundary")).getBytes();
InputStream is = new BufferedInputStream(ds.getInputStream());
PushbackInputStream pushbackInStream = new PushbackInputStream(is,
(boundary.length + 2));
readTillFirstBoundary(pushbackInStream, boundary);
while (pushbackInStream.available()>0){
MimeBodyPartInputStream partStream;
partStream = new MimeBodyPartInputStream(pushbackInStream,
boundary);
addBodyPart(new MimeBodyPart(partStream));
}
} catch (Exception e){
throw new MessagingException(e.toString(),e);
}
parsed = true;
}
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
pushbackInStream = new BufferedInputStream(is, 1200);
boundary = readTillFirstBoundary(pushbackInStream);
readTillFirstBoundary(pushbackInStream, boundary);
内容来源于网络,如有侵权,请联系作者删除!