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

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

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

MimeBodyPart.getInputStream介绍

[英]Return a decoded input stream for this body part's "content".

This implementation obtains the input stream from the DataHandler. That is, it invokes getDataHandler().getInputStream();
[中]返回此身体部位“内容”的解码输入流。
此实现从DataHandler获取输入流。也就是说,它调用getDataHandler()。getInputStream();

代码示例

代码示例来源:origin: voldemort/voldemort

  1. ByteArrayDataSource nestedDS = new ByteArrayDataSource(part.getInputStream(),
  2. "multipart/mixed");
  3. MimeMultipart valueParts = new MimeMultipart(nestedDS);
  4. InputStream input = valuePart.getInputStream();
  5. byte[] bodyPartBytes = new byte[contentLength];
  6. input.read(bodyPartBytes);

代码示例来源:origin: voldemort/voldemort

  1. VectorClockWrapper.class);
  2. InputStream input = part.getInputStream();
  3. byte[] bodyPartBytes = new byte[contentLength];
  4. input.read(bodyPartBytes);

代码示例来源:origin: voldemort/voldemort

  1. byte[] bodyPartBytes = new byte[contentLength];
  2. part.getInputStream().read(bodyPartBytes);
  3. response = new String(bodyPartBytes);

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. inputStream = decrypted.getInputStream();

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec

  1. /**
  2. * Save the body part content to a given target file.
  3. *
  4. * @param file The File object used to store the information.
  5. *
  6. * @exception IOException
  7. * @exception MessagingException
  8. */
  9. public void saveFile(File file) throws IOException, MessagingException {
  10. OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
  11. // we need to read the data in to write it out (sigh).
  12. InputStream in = getInputStream();
  13. try {
  14. byte[] buffer = new byte[8192];
  15. int length;
  16. while ((length = in.read(buffer)) > 0) {
  17. out.write(buffer, 0, length);
  18. }
  19. }
  20. finally {
  21. // make sure all of the streams are closed before we return
  22. if (in != null) {
  23. in.close();
  24. }
  25. if (out != null) {
  26. out.close();
  27. }
  28. }
  29. }

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. try {
  2. out = new BufferedOutputStream(new FileOutputStream(file));
  3. in = this.getInputStream();
  4. byte[] buf = new byte[8192];
  5. int len;

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

  1. public InputStream getContent() throws IOException, OxalisSecurityException, OxalisAs2Exception {
  2. try {
  3. if (signer == null)
  4. throw new OxalisSecurityException("Content is not validated.");
  5. return smimeSigned.getContent().getInputStream();
  6. } catch (MessagingException e) {
  7. throw new OxalisAs2Exception("Unable to fetch content.", e);
  8. }
  9. }

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

  1. public InputStream getContent() throws IOException, OxalisSecurityException, OxalisAs2Exception {
  2. try {
  3. if (signer == null)
  4. throw new OxalisSecurityException("Content is not validated.");
  5. return smimeSigned.getContent().getInputStream();
  6. } catch (MessagingException e) {
  7. throw new OxalisAs2Exception("Unable to fetch content.", e);
  8. }
  9. }

代码示例来源:origin: usnistgov/iheos-toolkit2

  1. map.put(name, bp.getContent());
  2. } else {
  3. map.put(name, bp.getInputStream()); //getDataHandler());

代码示例来源:origin: usnistgov/iheos-toolkit2

  1. map.put(name, bp.getContent());
  2. } else {
  3. map.put(name, bp.getInputStream()); //getDataHandler());

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

  1. public void handle(String action, Message msg, Map<Object, Object> options) throws OpenAS2Exception {
  2. // store message content
  3. try {
  4. File msgFile = getFile(msg, getParameter(PARAM_FILENAME, true), action);
  5. InputStream in = msg.getData().getInputStream();
  6. store(msgFile, in);
  7. logger.info("stored message to " + msgFile.getAbsolutePath()+msg.getLogMsgID());
  8. } catch (Exception e) {
  9. throw new DispositionException(new DispositionType("automatic-action", "MDN-sent-automatically",
  10. "processed", "Error", "Error storing transaction"), AS2ReceiverModule.DISP_STORAGE_FAILED, e);
  11. }
  12. String headerFilename = getParameter(PARAM_HEADER, false);
  13. if (headerFilename != null) {
  14. try {
  15. File headerFile = getFile(msg, headerFilename, action);
  16. InputStream in = getHeaderStream(msg);
  17. store(headerFile, in);
  18. logger.info("stored headers to " + headerFile.getAbsolutePath()+msg.getLogMsgID());
  19. } catch (IOException ioe) {
  20. throw new WrappedException(ioe);
  21. }
  22. }
  23. }

相关文章