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

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

本文整理了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

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

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

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

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

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

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

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

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

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

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

inputStream = decrypted.getInputStream();

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

/**
 * Save the body part content to a given target file.
 *
 * @param file   The File object used to store the information.
 *
 * @exception IOException
 * @exception MessagingException
 */
public void saveFile(File file) throws IOException, MessagingException {
  OutputStream out = new BufferedOutputStream(new FileOutputStream(file));
  // we need to read the data in to write it out (sigh).
  InputStream in = getInputStream();
  try {
    byte[] buffer = new byte[8192];
    int length;
    while ((length = in.read(buffer)) > 0) {
       out.write(buffer, 0, length);
    }
  }
  finally {
    // make sure all of the streams are closed before we return
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

public void handle(String action, Message msg, Map<Object, Object> options) throws OpenAS2Exception {
  // store message content
  try {
    File msgFile = getFile(msg, getParameter(PARAM_FILENAME, true), action);
    InputStream in = msg.getData().getInputStream();
    store(msgFile, in);
    logger.info("stored message to " + msgFile.getAbsolutePath()+msg.getLogMsgID());
  } catch (Exception e) {
    throw new DispositionException(new DispositionType("automatic-action", "MDN-sent-automatically",
        "processed", "Error", "Error storing transaction"), AS2ReceiverModule.DISP_STORAGE_FAILED, e);
  }
  String headerFilename = getParameter(PARAM_HEADER, false);
  if (headerFilename != null) {
    try {
      File headerFile = getFile(msg, headerFilename, action);
      InputStream in = getHeaderStream(msg);
      store(headerFile, in);
      logger.info("stored headers to " + headerFile.getAbsolutePath()+msg.getLogMsgID());
    } catch (IOException ioe) {
      throw new WrappedException(ioe);
    }
  }
}

相关文章