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

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

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

MimeBodyPart.getContentStream介绍

[英]Produce the raw bytes of the content. This method is used when creating a DataHandler object for the content. Subclasses that can provide a separate input stream for just the Part content might want to override this method.
[中]生成内容的原始字节。为内容创建DataHandler对象时使用此方法。可以仅为零件内容提供单独输入流的子类可能希望重写此方法。

代码示例

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

/**
 * Return an InputStream to the raw data with any Content-Transfer-Encoding
 * intact.  This method is useful if the "Content-Transfer-Encoding"
 * header is incorrect or corrupt, which would prevent the
 * <code>getInputStream</code> method or <code>getContent</code> method
 * from returning the correct data.  In such a case the application may
 * use this method and attempt to decode the raw data itself. <p>
 *
 * This implementation simply calls the <code>getContentStream</code>
 * method.
 *
 * @return    an InputStream containing the raw bytes
 * @exception    MessagingException for failures
 * @see    #getInputStream
 * @see    #getContentStream
 * @since    JavaMail 1.2
 */
public InputStream getRawInputStream() throws MessagingException {
return getContentStream();
}

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

/**
 * Return an InputStream to the raw data with any Content-Transfer-Encoding
 * intact.  This method is useful if the "Content-Transfer-Encoding"
 * header is incorrect or corrupt, which would prevent the
 * <code>getInputStream</code> method or <code>getContent</code> method
 * from returning the correct data.  In such a case the application may
 * use this method and attempt to decode the raw data itself. <p>
 *
 * This implementation simply calls the <code>getContentStream</code>
 * method.
 *
 * @return    an InputStream containing the raw bytes
 * @exception    MessagingException for failures
 * @see    #getInputStream
 * @see    #getContentStream
 * @since    JavaMail 1.2
 */
public InputStream getRawInputStream() throws MessagingException {
return getContentStream();
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

is = ((MimeBodyPart)part).getContentStream();
else if (part instanceof MimeMessage)
is = ((MimeMessage)part).getContentStream();

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

is = ((MimeBodyPart)part).getContentStream();
else if (part instanceof MimeMessage)
is = ((MimeMessage)part).getContentStream();

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

public InputStream getRawInputStream() throws MessagingException {
  return getContentStream();
}

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

public InputStream getRawInputStream() throws MessagingException {
  return getContentStream();
}

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

/**
 * Return an InputStream to the raw data with any Content-Transfer-Encoding
 * intact.  This method is useful if the "Content-Transfer-Encoding"
 * header is incorrect or corrupt, which would prevent the
 * <code>getInputStream</code> method or <code>getContent</code> method
 * from returning the correct data.  In such a case the application may
 * use this method and attempt to decode the raw data itself. <p>
 *
 * This implementation simply calls the <code>getContentStream</code>
 * method.
 *
 * @see    #getInputStream
 * @see    #getContentStream
 * @since    JavaMail 1.2
 */
public InputStream getRawInputStream() throws MessagingException {
return getContentStream();
}

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

/**
 * Return an InputStream to the raw data with any Content-Transfer-Encoding
 * intact.  This method is useful if the "Content-Transfer-Encoding"
 * header is incorrect or corrupt, which would prevent the
 * <code>getInputStream</code> method or <code>getContent</code> method
 * from returning the correct data.  In such a case the application may
 * use this method and attempt to decode the raw data itself. <p>
 *
 * This implementation simply calls the <code>getContentStream</code>
 * method.
 *
 * @see    #getInputStream
 * @see    #getContentStream
 * @since    JavaMail 1.2
 */
public InputStream getRawInputStream() throws MessagingException {
return getContentStream();
}

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

/**
 * Return an InputStream to the raw data with any Content-Transfer-Encoding
 * intact.  This method is useful if the "Content-Transfer-Encoding"
 * header is incorrect or corrupt, which would prevent the
 * <code>getInputStream</code> method or <code>getContent</code> method
 * from returning the correct data.  In such a case the application may
 * use this method and attempt to decode the raw data itself. <p>
 *
 * This implementation simply calls the <code>getContentStream</code>
 * method.
 *
 * @return    an InputStream containing the raw bytes
 * @exception    MessagingException for failures
 * @see    #getInputStream
 * @see    #getContentStream
 * @since    JavaMail 1.2
 */
public InputStream getRawInputStream() throws MessagingException {
return getContentStream();
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

InputStream getContentStream() throws MessagingException {
  InputStream is = null;
  if (part instanceof MimeBodyPart) {
  MimeBodyPart mbp = (MimeBodyPart)part;
  is = mbp.getContentStream();
  } else if (part instanceof MimeMessage) {
  MimeMessage msg = (MimeMessage)part;
  is = msg.getContentStream();
  }
  return is;
}

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

protected InputStream getContentStream() throws MessagingException {
  // no content loaded yet?
  if (content == null) {
    // make sure we're still valid
    message.checkValidity();
    // make sure the content is fully loaded
    loadContent();
  }
  // allow the super class to handle creating it from the loaded content.
  return super.getContentStream();
}

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

public InputStream getInputStream() throws IOException {
  try {
    InputStream stream;
    if (part instanceof MimeMessage) {
      stream = ((MimeMessage) part).getContentStream();
    } else if (part instanceof MimeBodyPart) {
      stream = ((MimeBodyPart) part).getContentStream();
    } else {
      throw new MessagingException("Unknown part");
    }
    return checkPartEncoding(part, stream);
  } catch (MessagingException e) {
    throw (IOException) new IOException(e.getMessage()).initCause(e);
  }
}

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

public InputStream getInputStream() throws IOException {
  try {
    InputStream stream;
    if (part instanceof MimeMessage) {
      stream = ((MimeMessage) part).getContentStream();
    } else if (part instanceof MimeBodyPart) {
      stream = ((MimeBodyPart) part).getContentStream();
    } else {
      throw new MessagingException("Unknown part");
    }
    String encoding = part.getEncoding();
    return encoding == null ? stream : MimeUtility.decode(stream, encoding);
  } catch (MessagingException e) {
    throw (IOException) new IOException(e.getMessage()).initCause(e);
  }
}

相关文章