本文整理了Java中javax.mail.internet.MimeBodyPart.writeTo()
方法的一些代码示例,展示了MimeBodyPart.writeTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeBodyPart.writeTo()
方法的具体详情如下:
包路径:javax.mail.internet.MimeBodyPart
类名称:MimeBodyPart
方法名:writeTo
[英]Output the body part as an RFC 822 format stream.
[中]以RFC 822格式流输出身体部位。
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: com.sun.mail/javax.mail
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: camunda/camunda-bpm-platform
MimeBodyPart.writeTo(this, os, ignoreList);
return;
代码示例来源:origin: com.sun.mail/javax.mail
MimeBodyPart.writeTo(this, os, ignoreList);
return;
代码示例来源:origin: resteasy/Resteasy
encrypted = generator.open(baos, encryptor);
_msg.writeTo(encrypted);
encrypted.close();
byte[] bytes = baos.toByteArray();
代码示例来源:origin: camunda/camunda-bpm-platform
for (int i = 0; i < parts.size(); i++) {
((MimeBodyPart)parts.elementAt(i)).writeTo(os);
代码示例来源:origin: com.sun.mail/javax.mail
for (int i = 0; i < parts.size(); i++) {
((MimeBodyPart)parts.elementAt(i)).writeTo(os);
代码示例来源:origin: javax.mail/com.springsource.javax.mail
/**
* Output the body part as an RFC 822 format stream.
*
* @exception MessagingException
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @see javax.activation.DataHandler#writeTo
*/
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: com.sun.mail/jakarta.mail
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: com.sun.mail/android-mail
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: org.glassfish.metro/webservices-extra
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail
/**
* Output the body part as an RFC 822 format stream.
*
* @exception MessagingException
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @see javax.activation.DataHandler#writeTo
*/
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: javax.mail/javax.mail-api
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: com.sun.mail/mailapi
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: jboss/jboss-javaee-specs
/**
* Output the body part as an RFC 822 format stream.
*
* @exception IOException if an error occurs writing to the
* stream or if an error is generated
* by the javax.activation layer.
* @exception MessagingException for other failures
* @see javax.activation.DataHandler#writeTo
*/
@Override
public void writeTo(OutputStream os)
throws IOException, MessagingException {
writeTo(this, os, null);
}
代码示例来源:origin: stackoverflow.com
MimeBodyPart body = new MimeBodyPart();
body.setContent(multiPart);
multipartSigned.addBodyPart(body);
msg.setContent(multipartSigned);
msg.saveChanges();
try (OutputStream str = Files.newOutputStream(Paths
.get(UNSIGNED_MIME))) {
body.writeTo(str);
str.close();
};
代码示例来源:origin: OpenAS2/OpenAs2App
public static String toString(MimeBodyPart mbp, boolean addDelimiterText) throws IOException, MessagingException
{
ByteArrayOutputStream os = new ByteArrayOutputStream();
if (addDelimiterText) os.write("========BEGIN MIMEBODYPART=========\n".getBytes());
mbp.writeTo(os);
if (addDelimiterText) os.write("\n========END MIMEBODYPART=========".getBytes());
return os.toString();
}
代码示例来源:origin: OpenAS2/OpenAs2App
public static void write(OutputStream os, MimeBodyPart mbp) throws MessagingException, IOException
{
os.write((System.getProperty("line.separator") + "========BEGIN MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes());
mbp.writeTo(os);
os.write((System.getProperty("line.separator") + "========END MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes());
}
代码示例来源:origin: no.difi.oxalis/oxalis-as2
/**
* Calculates sha1 mic based on the MIME body part.
*/
public static Digest calculateMic(MimeBodyPart bodyPart, SMimeDigestMethod digestMethod) {
try {
MessageDigest md = BCHelper.getMessageDigest(digestMethod.getIdentifier());
bodyPart.writeTo(new DigestOutputStream(ByteStreams.nullOutputStream(), md));
return Digest.of(digestMethod.getDigestMethod(), md.digest());
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException(digestMethod.getIdentifier() + " not found", e);
} catch (IOException e) {
throw new IllegalStateException("Unable to read data from digest input. " + e.getMessage(), e);
} catch (MessagingException e) {
throw new IllegalStateException("Unable to handle mime body part. " + e.getMessage(), e);
}
}
代码示例来源:origin: difi/oxalis
/**
* Calculates sha1 mic based on the MIME body part.
*/
public static Digest calculateMic(MimeBodyPart bodyPart, SMimeDigestMethod digestMethod) {
try {
MessageDigest md = BCHelper.getMessageDigest(digestMethod.getIdentifier());
bodyPart.writeTo(new DigestOutputStream(ByteStreams.nullOutputStream(), md));
return Digest.of(digestMethod.getDigestMethod(), md.digest());
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException(digestMethod.getIdentifier() + " not found", e);
} catch (IOException e) {
throw new IllegalStateException("Unable to read data from digest input. " + e.getMessage(), e);
} catch (MessagingException e) {
throw new IllegalStateException("Unable to handle mime body part. " + e.getMessage(), e);
}
}
内容来源于网络,如有侵权,请联系作者删除!