Java NIO Series Tutorials

Source: Internet
Author: User

Java NiO (New io) is an IO API that can replace the standard Java IO API (starting with Java 1.4), and Java NiO provides different IO working methods than standard IO.

Java Nio:channels and buffers (channels and buffers)

The standard IO is based on the byte stream and the character stream, and NiO is based on the channels (channel) and buffers (buffer), where the data is always read from the channel to the buffer or written to the channel from the buffer.

Java nio:non-blocking io (non-blocking IO)

Java NIO allows you to use IO in a non-blocking way, for example: When a thread reads data from a channel to a buffer, the thread can do something else. When the data is written to the buffer, the thread can continue to process it. Writing a channel from a buffer is similar.

Java nio:selectors (selector)

Java NiO introduces the concept of selectors, which are used to listen for events on multiple channels (e.g., connection open, data arrival). Therefore, a single thread can listen on multiple data channels.

Java NIO Series Tutorials

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.