Several constructors about messagepart in j2's Architecture

Source: Internet
Author: User

The three functions are the construction functions of messagepart. Now let's analyze the differences.

<Br/> messagepart (byte [] Contents, string mimetype, string contentid, string contentlocation, string ENC) <br/>

This function places the resource array completely in messagepart.

In theory, the maximum array size limit is less than 10 K (roughly less than 10 K). However, after trying to use some mobile phones, this limit is much larger than 10 K,

 

 

Messagpart (byte [] Contents, int offset, int length, string mimetype, contentid, string contentlocation, string ENC) <br/>

This function can be used to capture the content in the resource array. the size limit is also 10 KB,

 

Messagepart (inputstream is, string mimetype, string contentid, string contentloaction, string ENC)

 

This function uses the resource stream to save the trouble of converting the stream into an array. At the same time, it does not limit the size of resources to be sent.

I have never used this constructor ,,

However, when you encounter sizeexceededexception, try this constructor, especially on some low-end models,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.