Chapter 7
Channels
Channels partner with buffers to achieve high-performance I/O. This chapter introduces you to NIO’s channel types.
Introducing Channels
A channel is an object that represents an open connection to a hardware device, a file, a network socket, an application component, or another entity that’s capable of performing writes, reads, and other I/O operations. Channels efficiently transfer data between byte buffers and operating system-based I/O service sources or destinations.
Note Channels are gateways through which I/O services are accessed. Channels use byte buffers as the endpoints for sending and receiving data.
There often exists a one-to-one correspondence between an operating system file handle or file descriptor and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access