本文整理了Java中javax.mail.internet.MimeBodyPart.getSize()
方法的一些代码示例,展示了MimeBodyPart.getSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeBodyPart.getSize()
方法的具体详情如下:
包路径:javax.mail.internet.MimeBodyPart
类名称:MimeBodyPart
方法名:getSize
[英]Return the size of the content of this body part in bytes. Return -1 if the size cannot be determined.
Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.
This implementation returns the size of the content
array (if not null), or, if contentStream
is not null, and the available
method returns a positive number, it returns that number as the size. Otherwise, it returns -1.
[中]返回此正文部分内容的大小(字节)。如果无法确定大小,则返回-1。
请注意,这个数字可能不是内容大小的精确测量值,也可能不是内容传输编码的原因。
这个实现返回content
数组的大小(如果不是null),或者,如果contentStream
不是null,并且available
方法返回一个正数,它将该数字作为大小返回。否则,返回-1。
代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl
int mbpSize = mbp.getSize();
if ( (attachmentRunningTotal + mbpSize) < maxAttachmentSize )
代码示例来源:origin: org.apache.axis/axis
dataSize = bp.getSize();
代码示例来源:origin: axis/axis
dataSize = bp.getSize();
代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis
dataSize = bp.getSize();
代码示例来源:origin: org.apache.axis2.transport/axis2-transport-mail
private void updateMetrics(Message message) throws IOException, MessagingException {
if (message instanceof MimeMessage) {
MimeMessage mimeMessage = (MimeMessage) message;
if (mimeMessage.getContent() instanceof Multipart) {
Multipart mp = (Multipart) mimeMessage.getContent();
for (int i=0; i<mp.getCount(); i++) {
MimeBodyPart mbp = (MimeBodyPart) mp.getBodyPart(i);
int size = mbp.getSize();
if (size != -1) {
metrics.incrementBytesReceived(size);
}
}
} else {
int size = mimeMessage.getSize();
if (size != -1) {
metrics.incrementBytesReceived(size);
}
}
}
}
代码示例来源:origin: org.apache.axis2/axis2-transport-mail
private void updateMetrics(Message message) throws IOException, MessagingException {
if (message instanceof MimeMessage) {
MimeMessage mimeMessage = (MimeMessage) message;
if (mimeMessage.getContent() instanceof Multipart) {
Multipart mp = (Multipart) mimeMessage.getContent();
for (int i=0; i<mp.getCount(); i++) {
MimeBodyPart mbp = (MimeBodyPart) mp.getBodyPart(i);
int size = mbp.getSize();
if (size != -1) {
metrics.incrementBytesReceived(size);
}
}
} else {
int size = mimeMessage.getSize();
if (size != -1) {
metrics.incrementBytesReceived(size);
}
}
}
}
代码示例来源:origin: apache/axis2-java
private void updateMetrics(Message message) throws IOException, MessagingException {
if (message instanceof MimeMessage) {
MimeMessage mimeMessage = (MimeMessage) message;
if (mimeMessage.getContent() instanceof Multipart) {
Multipart mp = (Multipart) mimeMessage.getContent();
for (int i=0; i<mp.getCount(); i++) {
MimeBodyPart mbp = (MimeBodyPart) mp.getBodyPart(i);
int size = mbp.getSize();
if (size != -1) {
metrics.incrementBytesReceived(size);
}
}
} else {
int size = mimeMessage.getSize();
if (size != -1) {
metrics.incrementBytesReceived(size);
}
}
}
}
代码示例来源:origin: com.helger/ph-as4-lib
if (canBeKeptInMemory (aBodyPart.getSize ()))
内容来源于网络,如有侵权,请联系作者删除!