Synopses & Reviews
Many serious Java programmers, especially enterprise Java programmers, consider the new I/O API--called NIO for New Input/Output--the most important feature in the 1.4 version of the Java 2 Standard Edition. The NIO package includes many things that have been missing from previous editions of Java that are critical to writing high-performance, large-scale applications: improvements in the areas of buffer management, scalable network and file I/O, character-set support, and regular expression matching. Most of all, it boosts performance and speed dramatically.Java NIO explores the new I/O capabilities of version 1.4 in detail and shows you how to put these features to work to greatly improve the efficiency of the Java code you write. This compact volume examines the typical challenges that Java programmers face with I/O and shows you how to take advantage of the capabilities of the new I/O features. You?ll learn how to put these tools to work using examples of common, real-world I/O problems and see how the new features have a direct impact on responsiveness, scalability, and reliability. The book includes:
- A rundown of the new features in NIO
- Basic and advanced I/O Concepts
- Binary I/O and the new buffer classes
- Memory mapped files and file locking
- Character I/O: encoding, decoding and transforming character data
- Regular Expressions and the new java.util.regex package
- Muliplexing with java.nio
Because the NIO APIs supplement the I/O features of version 1.3, rather than replace them, you'll also learn when to use new APIs and when the older 1.3 I/O APIs are better suited to your particular application.
Java NIO is for any Java programmer who is interested in learning how to boost I/O performance, but if you're developing applications where performance is critical, such as game computing or large-scale enterprise applications, you'll want to give this book a permanent spot on your bookshelf. With the NIO APIs, Java no longer takes a backseat to any language when it comes to performance.
Java NIO will help you realize the benefits of these exciting new features.
Synopsis
This title provides a complete introduction to this major improvement in the new 1.4 version of Java, the new Java.Nio package. It includes information missing from previous editions of Java that are critical to writing high-performance applications.
Table of Contents
Copyright; Dedication; Preface; Organization; Who Should Read This Book; Software and Versions; Conventions Used in This Book; How to Contact Us; Acknowledgments; Chapter 1: Introduction; 1.1 I/O Versus CPU Time; 1.2 No Longer CPU Bound; 1.3 Getting to the Good Stuff; 1.4 I/O Concepts; 1.5 Summary; Chapter 2: Buffers; 2.1 Buffer Basics; 2.2 Creating Buffers; 2.3 Duplicating Buffers; 2.4 Byte Buffers; 2.5 Summary; Chapter 3: Channels; 3.1 Channel Basics; 3.2 Scatter/Gather; 3.3 File Channels; 3.4 Memory-Mapped Files; 3.5 Socket Channels; 3.6 Pipes; 3.7 The Channels Utility Class; 3.8 Summary; Chapter 4: Selectors; 4.1 Selector Basics; 4.2 Using Selection Keys; 4.3 Using Selectors; 4.4 Asynchronous Closability; 4.5 Selection Scaling; 4.6 Summary; Chapter 5: Regular Expressions; 5.1 Regular Expression Basics; 5.2 The Java Regular Expression API; 5.3 Regular Expression Methods of the String Class; 5.4 Java Regular Expression Syntax; 5.5 An Object-Oriented File Grep; 5.6 Summary; Chapter 6: Character Sets; 6.1 Character Set Basics; 6.2 Charsets; 6.3 The Charset Service Provider Interface; 6.4 Summary; Appendix A: NIO and the JNI; Appendix B: Selectable Channels SPI; Appendix C: NIO Quick Reference; C.1 Package java.nio; C.2 Package java.nio.channels; C.3 Package java.nio.channels.spi; C.4 Package java.nio.charset; C.5 Package java.nio.charset.spi; C.6 Package java.util.regex; Colophon;