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

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

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

MimeMessage.getContentStream介绍

[英]Produce the raw bytes of the content. This method is used during parsing, to create a DataHandler object for the content. Subclasses that can provide a separate input stream for just the message content might want to override this method.

This implementation returns a SharedInputStream, if contentStream is not null. Otherwise, it returns a ByteArrayInputStream constructed out of the content byte array.
[中]生成内容的原始字节。此方法在解析期间用于为内容创建DataHandler对象。可以为消息内容提供单独输入流的子类可能希望重写此方法。
如果contentStream不为空,此实现将返回SharedInputStream。否则,它将返回由content字节数组构造的ByteArrayInputStream。

代码示例

代码示例来源: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

byte[] buf = new byte[8192];
try {
is = getContentStream();

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

byte[] buf = new byte[8192];
try {
is = getContentStream();

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

is = ((MimeBodyPart)part).getContentStream();
else if (part instanceof MimeMessage)
is = ((MimeMessage)part).getContentStream();
else
throw new MessagingException("Unknown part");

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

is = ((MimeBodyPart)part).getContentStream();
else if (part instanceof MimeMessage)
is = ((MimeMessage)part).getContentStream();
else
throw new MessagingException("Unknown part");

代码示例来源: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/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: 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: org.mnode.mstor/mstor

/**
 * {@inheritDoc}
 */
protected InputStream getContentStream() throws MessagingException {
  checkParse();
  return super.getContentStream();
}

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

/**
 * @see javax.mail.internet.MimeMessage#getContentStream()
 */
protected InputStream getContentStream() throws MessagingException {
  // get the article information.
  loadArticle();
  return super.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: org.apache.james/james-server-core-library

/**
 * @see javax.mail.internet.MimeMessage#getContentStream()
 */
protected InputStream getContentStream() throws MessagingException {
  if (!messageParsed) {
    loadMessage();
  }
  return super.getContentStream();
}

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

/**
 * @see javax.mail.internet.MimeMessage#getContentStream()
 */
protected InputStream getContentStream() throws MessagingException {
  // get the article information.
  loadArticle();
  return super.getContentStream();
}

代码示例来源: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: com.sun.mail/javax.mail

protected InputStream getContentStream() throws MessagingException {
if (bodyLoaded)
  return super.getContentStream();
InputStream is = null;
boolean pk = getPeek();	// get before acquiring message cache lock

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

return super.getContentStream();
InputStream is = null;
boolean pk = getPeek();	// get before acquiring message cache lock

相关文章

MimeMessage类方法