javax.mail.internet.MimeBodyPart.writeTo()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中javax.mail.internet.MimeBodyPart.writeTo()方法的一些代码示例,展示了MimeBodyPart.writeTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeBodyPart.writeTo()方法的具体详情如下:
包路径:javax.mail.internet.MimeBodyPart
类名称:MimeBodyPart
方法名:writeTo

MimeBodyPart.writeTo介绍

[英]Output the body part as an RFC 822 format stream.
[中]以RFC 822格式流输出身体部位。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. public void writeTo(OutputStream os)
  11. throws IOException, MessagingException {
  12. writeTo(this, os, null);
  13. }

代码示例来源:origin: com.sun.mail/javax.mail

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. @Override
  11. public void writeTo(OutputStream os)
  12. throws IOException, MessagingException {
  13. writeTo(this, os, null);
  14. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. MimeBodyPart.writeTo(this, os, ignoreList);
  2. return;

代码示例来源:origin: com.sun.mail/javax.mail

  1. MimeBodyPart.writeTo(this, os, ignoreList);
  2. return;

代码示例来源:origin: resteasy/Resteasy

  1. encrypted = generator.open(baos, encryptor);
  2. _msg.writeTo(encrypted);
  3. encrypted.close();
  4. byte[] bytes = baos.toByteArray();

代码示例来源:origin: camunda/camunda-bpm-platform

  1. for (int i = 0; i < parts.size(); i++) {
  2. ((MimeBodyPart)parts.elementAt(i)).writeTo(os);

代码示例来源:origin: com.sun.mail/javax.mail

  1. for (int i = 0; i < parts.size(); i++) {
  2. ((MimeBodyPart)parts.elementAt(i)).writeTo(os);

代码示例来源:origin: javax.mail/com.springsource.javax.mail

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception MessagingException
  5. * @exception IOException if an error occurs writing to the
  6. * stream or if an error is generated
  7. * by the javax.activation layer.
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. public void writeTo(OutputStream os)
  11. throws IOException, MessagingException {
  12. writeTo(this, os, null);
  13. }

代码示例来源:origin: com.sun.mail/jakarta.mail

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. @Override
  11. public void writeTo(OutputStream os)
  12. throws IOException, MessagingException {
  13. writeTo(this, os, null);
  14. }

代码示例来源:origin: com.sun.mail/android-mail

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. @Override
  11. public void writeTo(OutputStream os)
  12. throws IOException, MessagingException {
  13. writeTo(this, os, null);
  14. }

代码示例来源:origin: org.glassfish.metro/webservices-extra

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. @Override
  11. public void writeTo(OutputStream os)
  12. throws IOException, MessagingException {
  13. writeTo(this, os, null);
  14. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception MessagingException
  5. * @exception IOException if an error occurs writing to the
  6. * stream or if an error is generated
  7. * by the javax.activation layer.
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. public void writeTo(OutputStream os)
  11. throws IOException, MessagingException {
  12. writeTo(this, os, null);
  13. }

代码示例来源:origin: javax.mail/javax.mail-api

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. @Override
  11. public void writeTo(OutputStream os)
  12. throws IOException, MessagingException {
  13. writeTo(this, os, null);
  14. }

代码示例来源:origin: com.sun.mail/mailapi

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. @Override
  11. public void writeTo(OutputStream os)
  12. throws IOException, MessagingException {
  13. writeTo(this, os, null);
  14. }

代码示例来源:origin: jboss/jboss-javaee-specs

  1. /**
  2. * Output the body part as an RFC 822 format stream.
  3. *
  4. * @exception IOException if an error occurs writing to the
  5. * stream or if an error is generated
  6. * by the javax.activation layer.
  7. * @exception MessagingException for other failures
  8. * @see javax.activation.DataHandler#writeTo
  9. */
  10. @Override
  11. public void writeTo(OutputStream os)
  12. throws IOException, MessagingException {
  13. writeTo(this, os, null);
  14. }

代码示例来源:origin: stackoverflow.com

  1. MimeBodyPart body = new MimeBodyPart();
  2. body.setContent(multiPart);
  3. multipartSigned.addBodyPart(body);
  4. msg.setContent(multipartSigned);
  5. msg.saveChanges();
  6. try (OutputStream str = Files.newOutputStream(Paths
  7. .get(UNSIGNED_MIME))) {
  8. body.writeTo(str);
  9. str.close();
  10. };

代码示例来源:origin: OpenAS2/OpenAs2App

  1. public static String toString(MimeBodyPart mbp, boolean addDelimiterText) throws IOException, MessagingException
  2. {
  3. ByteArrayOutputStream os = new ByteArrayOutputStream();
  4. if (addDelimiterText) os.write("========BEGIN MIMEBODYPART=========\n".getBytes());
  5. mbp.writeTo(os);
  6. if (addDelimiterText) os.write("\n========END MIMEBODYPART=========".getBytes());
  7. return os.toString();
  8. }

代码示例来源:origin: OpenAS2/OpenAs2App

  1. public static void write(OutputStream os, MimeBodyPart mbp) throws MessagingException, IOException
  2. {
  3. os.write((System.getProperty("line.separator") + "========BEGIN MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes());
  4. mbp.writeTo(os);
  5. os.write((System.getProperty("line.separator") + "========END MIMEBODYPART=========" + System.getProperty("line.separator")).getBytes());
  6. }

代码示例来源:origin: no.difi.oxalis/oxalis-as2

  1. /**
  2. * Calculates sha1 mic based on the MIME body part.
  3. */
  4. public static Digest calculateMic(MimeBodyPart bodyPart, SMimeDigestMethod digestMethod) {
  5. try {
  6. MessageDigest md = BCHelper.getMessageDigest(digestMethod.getIdentifier());
  7. bodyPart.writeTo(new DigestOutputStream(ByteStreams.nullOutputStream(), md));
  8. return Digest.of(digestMethod.getDigestMethod(), md.digest());
  9. } catch (NoSuchAlgorithmException e) {
  10. throw new IllegalStateException(digestMethod.getIdentifier() + " not found", e);
  11. } catch (IOException e) {
  12. throw new IllegalStateException("Unable to read data from digest input. " + e.getMessage(), e);
  13. } catch (MessagingException e) {
  14. throw new IllegalStateException("Unable to handle mime body part. " + e.getMessage(), e);
  15. }
  16. }

代码示例来源:origin: difi/oxalis

  1. /**
  2. * Calculates sha1 mic based on the MIME body part.
  3. */
  4. public static Digest calculateMic(MimeBodyPart bodyPart, SMimeDigestMethod digestMethod) {
  5. try {
  6. MessageDigest md = BCHelper.getMessageDigest(digestMethod.getIdentifier());
  7. bodyPart.writeTo(new DigestOutputStream(ByteStreams.nullOutputStream(), md));
  8. return Digest.of(digestMethod.getDigestMethod(), md.digest());
  9. } catch (NoSuchAlgorithmException e) {
  10. throw new IllegalStateException(digestMethod.getIdentifier() + " not found", e);
  11. } catch (IOException e) {
  12. throw new IllegalStateException("Unable to read data from digest input. " + e.getMessage(), e);
  13. } catch (MessagingException e) {
  14. throw new IllegalStateException("Unable to handle mime body part. " + e.getMessage(), e);
  15. }
  16. }

相关文章