Java NIO
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
Electronic reproduction. [S.l.] : HathiTrust Digital Library
Master and use copy. Digital master created according to Benchmark for Faithful Digital Reproductions of Monographs and Serials, Version 1. Digital Library Federation, December 2002
1. Introduction — 2. Buffers — 3. Channels — 4. Selectors — 5. Regular Expressions — 6. Character Sets — A. NIO and the JNI — B. Selectable Channels SPI — C. NIO Quick Reference
Access-restricted-item true Addeddate 2020-10-01 19:06:56 Boxid IA1951620 Camera USB PTP Class Camera Collection_set printdisabled External-identifier urn:oclc:record:52355520
urn:lcp:javanio0000hitc:lcpdf:20505efb-ad7b-4c16-a14c-89fbe2f50fe2
urn:lcp:javanio0000hitc:epub:9fe6af4d-5da4-4c41-950e-90a9a7641da4 Foldoutcount 0 Identifier javanio0000hitc Identifier-ark ark:/13960/t1rg55h7s Invoice 1652 Isbn 9780596516611
0596516614
9780596002886 Ocr_converted abbyy-to-hocr 1.1.20 Ocr_module_version 0.0.17 Old_pallet IA19211 Openlibrary_edition OL22482221M Openlibrary_work OL8167342W Page_number_confidence 91.23 Pages 310 Partner Innodata Ppi 300 Rcs_key 24143 Republisher_date 20201001212032 Republisher_operator associate-rochelle-sesaldo@archive.org Republisher_time 420 Scandate 20200929171942 Scanner station50.cebu.archive.org Scanningcenter cebu Scribe3_search_catalog isbn Scribe3_search_id 9780596002886 Tts_version 4.0-initial-155-gbba175a5 Worldcat (source edition) 52355520
Code And Slides
Code for the prototype NIO multiplexed server that I’ve presented at JavaOne and SD West can be found here, along with the SD West 2008 slides.
The code examples from the book are available online here.
Some presentations that I’ve given at various conferences can be found over at ronsoft.com
Older NIO presentations can be found here
Book Reviews
Buy The Book
O’Reilly
Ron Hitchens
Welcome
This is the support site for the book Java NIO by Ron Hitchens, published by O’Reilly & Associates.
This site hosts the code examples associated with the book and provides other information about the book and the topics it covers.
Click on the Pig-Footed Bandicoot to the right to see the book’s cover art.
SD West March 9-13, 2009
I’m speaking at SD West 2009, on March 13th (Friday). I’m doing just one talk this time around. It’s another update to my server talks from the last two years, How To Build a Scalable, Multiplexed Server Using NIO, Mark III.
This time I’ll be concentrating on some sample applications that you can build on top of the NIO multiplexing framework.
Slides for this and other presentations can (or will) be found here. Information about accessing the code from my Subversion repository is here.
NIO Visualization Tools
You can find two GUI demo tools that I developed a while back to help visualize the way NIO Buffers and Selectors work. These are ready-to-run JARs, just do ‘java -jar bufferdemo.jar’ or ‘java -jar selectdemo.jar’ to run them. No need to set the classpath. On Windows and Mac, if things are setup properly, you can just double-click the icon for the jar file.
Click here to download the demos.
Gotta Question?
If you have a question or comment about NIO or any other subject, feel free to contact me: . I’ll do my best to get back to you in a timely manner (within reason of course).
Note: If you don’t hear from me within a few days, try again. Emails from random people (that’s you) often get flagged as spam and I don’t see them. Also, I’ve occasionally not been able to reply to a question because the sender’s corporate mail system won’t let my response through.
Gotta Problem?
If you need help with an NIO problem, or anything within my expertise, I can provide consulting services worldwide. Please directly and I’ll make the pain go away.
Update: I’m now employed full-time, so my availabilty for consulting projects is limited. But I still may be able to help.
Upcoming Stuff
I’m now working full-time at Mark Logic Corporation, which keeps me pretty busy. I haven’t been doing much speaking on the subject of NIO lately. If you’d like me to give a talk about NIO, contact me.
Stuff You May Have Missed
I spoke at SD West 2008, on March 5th and 6th. I gave two NIO talks this time around. The first is entitled What’s New In NIO.2 about the new NIO features that will be available in Java 7 (JSR-203).
The second is an update to my server talk from 2007, How To Build a Scalable, Multiplexed Server Using NIO, Mark II. Some improvements have been made to the design with an eye to better leveraging the concurrency APIs and improving worker thread management.
Final slides for both presentations as well as the code for the server prototype are available here. There is also information there about accessing the Subversion repository for all the code.
March 19 — 23, 2007: SD West
I spoke at SD West 2007, on March 23rd at 3:30pm. The topic was How To Build a Scalable, Multiplexed Server Using NIO. The slides can be found here.
This talk is based on experiences I’ve had writing server frameworks using NIO on J2SE 1.4. I updated the code used in the slides to make use of 1.5 features.
The codebase upon which the samples are based is 1.4-only and not as cleanly abstracted as I’d like, especially for a use as a teaching example. It is, however, well-tested and production quality.
The example code in the slides has been updated to the more modern 1.5 syntax but is not a complete port of the original functionality. But it can still be informative as an example to get you started.
I haven’t had a chance to neatly package the code for distribution yet. But it is available under an Apache 2.0 license. You will need a copy of the Subversion client (svn). The command to issue to check out the sources is: svn co svn://javanio.info/protoplex
If you download the code, please let me know (email address is below). If you’re interested in helping complete the port to 1.5 and/or add new features, please get in touch with me to gain commit access to the repository.
I did a talk with Jason Hunter at JavaOne in San Francisco entitled XQuery For the Java Geek. It was about making use of XQuery from Java. Mark Logic (where Jason and I both work) makes a high performance XML content server based on XQuery.
There was nothing about NIO in this talk, but we won a Top-20 award, so it must have been pretty good. The presentation can be found online here.
December 3-4, 2003: JavaPolis 2003, Antwerp, Belgium
I’ll be speaking at JavaPolis in Antwerp, Belgium as a part of the Java@University track on December 3rd.
If you plan to attend, please let me know or contact me at the conference, I’d love to hear from European readers.
July 7, 2003 — July 11, 2003: OSCON 2003, Portland, Oregon
My proposal for an NIO tutorial at the O’Reilly Open Source Conference in Portland was declined (they had one last year and it didn’t fit with the theme this year) but I am speaking on the subject of JDO, Wednesday, July 9 at 4:30pm.
I plan to attend JavaOne at the Moscone Convention Center in San Francisco, as will several thousand other Java developers. I once worked across the street from Moscone for a year.
May 14, 2003: Java Metroplex User Group Presentation, Dallas
I will be giving an NIO presentation at the Java Metroplex User Group (JavaMUG) on Wednesday, May 14, 2003 in Dallas, Texas. I lived in Texas for a total of 12 years — Austin, San Antonio and Houston — but never in Dallas.
May 15, 2003: Utah JUG Presentation
I will be giving an NIO presentation at the Utah Java Users group (UJUG) on Thursday, May 15, 2003 in Salt Lake City. Salt Lake is my hometown — I haven’t been back there in several years.
May 20, 2003: San Diego JUG Presentation
I will be giving an NIO presentation at the San Diego Java Users group (SDJUG) on Tuesday, May 20, 2003 in San Diego.
May 8, 2003: Orange County JUG Presentation
I will be giving another NIO presentation at the Orange County Java User group (OCJUG) on Thursday, May 8, 2003 in Irvine on the UC Irvine campus. I did a presentation there once before. This one will have new demos and more code examples. There will also be a short presentation on Conga.
Apr 15 — Apr 17, 2003: JavaRanch.com Featured Book
Java NIO will be the featured book on Java Ranch the third week of April. Sign up for a chance to win a free copy of the book. I’ll be answering reader’s questions online. Forget your tax woes and come on along.
Mar 24, 2003 — Mar 28, 2003: Software Development Expo, Santa Clara, California
I will be attending SDExpo 2003 in Santa Clara. I’m not speaking (Jason Hunter will be presenting a session on NIO) but will be there.
Feb 4, 2003: LAJUG Presentation
I will be giving an NIO presentation at the Los Angeles Java User group (LAJUG) on Tuesday, February 4, 2003 in Pasadena at the offices of Overture. I was originally scheduled for March but moved up to fill in for someone who needed to cancel.
Update: The slides, in OpenOffice Impress format, and example code for this presentation are online here.
Late 2002: Java NIO now available in a bookstore near you
Java NIO has made its way through the distribution chain and is now on the shelves of fine booksellers worldwide. Look for it whereever O’Reilly Java books are sold.
Oct 15, 2002: NIO article on onjava.com.
I wrote a Top Ten article for O’Reilly’s OnJava website. You can jump directly to it by clicking this graphic.
Sep 24, 2002: Java NIO has been spotted!
I’ve seen Java NIO on the shelf at MicroCenter near me (Southern California). Still waiting for it to show up at Barnes & Noble.
Aug 28, 2002: Java NIO has hit the shelves!
I still haven’t received my author’s copies, and the major online booksellers (see left sidebar) don’t show it in stock yet, but I’ve already received email from people who’ve bought it. It should be in your local bookestore soon, keep an eye out for it.
If you spot it in a bookstore, drop me a line at and let me know where you saw it.
Java NIO : Regular Expressions and High-Performance I/O
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
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.