Application scenarios of bytebuffer dispersion and aggregation

Source: Internet
Author: User

Scattered/clustered I/O is useful for dividing data into several parts. For example, you may write a network application that uses message objects.ProgramEach message is divided into a fixed-length header and a fixed-length body. You can create a buffer that can accommodate the header and a buffer that can accommodate the hard body. When you put them into an array and use distributed reads to read messages into them, the header and body are neatly divided into the two buffers.
The convenience we get from the buffer zone is equally effective for the buffer array. Because each buffer zone tracks the amount of data it can accept, the first buffer zone with space to accept data is automatically located for Distributed reads. After the buffer is filled up, it will be moved to the next buffer zone.

 

 

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.