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 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 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.
This book suffers from a number of problems: the author only scratches the surface of the topics, giving shallow explanations of how things are supposed to work under the hood, but offering no references to support arguments or to help the reader delve even deeper into his knowledge. There is simply no way to reach the same level of understanding as the author on how Java NIO works without the readers perusing the JVM source code themselves. Some of his chapters contain verbatim copies of the Java API documentation, without the author offering any additional insights. The book is outdated, it is from the time of JDK 4, and I'm writing this review at the point when JDK 14 is the latest. So, there is a lot of things the book does not cover, for example, asynchronous channels and everything in so-called NIO 2, both introduced in JDK 7.
However, for me, its biggest flaw is failing to truly cover in rich details everything related to the implementation of non-blocking I/O APIs. Particularly the examples for the chapters on selectors are extremely superficial and in many cases, the author himself fails to explain in full details how to deal with the non-blocking nature of reads and writes, how to control with backpressure, how to properly implement a reactor pattern, etc.
Unfortunately, today, this is one of the few books covering this topic and so most of us must make do with this and whatever other bits of information we can find on the web. I cannot say the book is all bad, reading it was not a waste of time. I did learn a lot, but the book is not as good as I was expecting.
This is definitively an area where somebody could write a very good book that could become a real classic.