Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

3.8. Summary

We covered a lot of ground in this chapter. Channels make up the infrastructure, or the plumbing, which carries data between ByteBuffers and I/O services of the operating system (or whatever the channel is connected to). The key concepts discussed in this chapter were:


Basic channel operations

In Section 3.1, we learned the basic operations of channels. These included how to open a channel using the API calls common to all channels and how to close a channel when finished.


Scatter/gather channels

The topic of scatter/gather I/O using channels was introduced in Section 3.2. Vectored I/O enables you to perform one I/O operation across multiple buffers automatically.


File channels

The multifaceted FileChannel class was discussed in Section 3.3. This powerful new channel provides access to advanced file operations not previously available to Java programs. Among these new capabilities are file locking, memory-mapped files, and channel-to-channel transfers.


Socket channels

The several types of socket channels were covered in Section 3.5. Also discussed was nonblocking mode, an important new feature supported by socket channels.


Pipes

In Section 3.6, we looked at the Pipe class, a useful new loopback mechanism using specialized channel implementations.


Channels utility class

The Channels class contains utility methods that provide for cross-connecting channels with conventional byte streams and character reader/writer objects. See Section 3.7.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint