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.
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.
-
Chapter 1 Introduction
-
I/O Versus CPU Time
-
No Longer CPU Bound
-
Getting to the Good Stuff
-
I/O Concepts
-
Summary
-
-
Chapter 2 Buffers
-
Buffer Basics
-
Creating Buffers
-
Duplicating Buffers
-
Byte Buffers
-
Summary
-
-
Chapter 3 Channels
-
Channel Basics
-
Scatter/Gather
-
File Channels
-
Memory-Mapped Files
-
Socket Channels
-
Pipes
-
The Channels Utility Class
-
Summary
-
-
Chapter 4 Selectors
-
Selector Basics
-
Using Selection Keys
-
Using Selectors
-
Asynchronous Closability
-
Selection Scaling
-
Summary
-
-
Chapter 5 Regular Expressions
-
Regular Expression Basics
-
The Java Regular Expression API
-
Regular Expression Methods of the String Class
-
Java Regular Expression Syntax
-
An Object-Oriented File Grep
-
Summary
-
-
Chapter 6 Character Sets
-
Character Set Basics
-
Charsets
-
The Charset Service Provider Interface
-
Summary
-
-
Appendix A NIO and the JNI
-
Appendix B Selectable Channels SPI
-
Appendix C NIO Quick Reference
-
Package java.nio
-
Package java.nio.channels
-
Package java.nio.channels.spi
-
Package java.nio.charset
-
Package java.nio.charset.spi
-
Package java.util.regex
-
-
Colophon
- Title:
- Java NIO
- By:
- Ron Hitchens
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- August 2002
- Ebook Release:
- June 2009
- Pages:
- 304
- Print ISBN:
- 978-0-596-00288-6
- | ISBN 10:
- 0-596-00288-2
- Ebook ISBN:
- 978-0-596-55604-4
- | ISBN 10:
- 0-596-55604-7
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Java NIO is a pig-footed bandicoot (Chaeropus ecaudatus). Though a specimen has not been uncovered since the early 20th century, pigfooted bandicoots were once found throughout central and south Australia and in Victoria. These rabbit-like creatures dwelled in many habitats. In the central deserts, they took up residence in sand dunes. In Victoria, they lived in grassy plains. In other areas, they preferred open woodland with shrubs and grass.
Pig-footed bandicoots grew to be about 230-260 millimeters in length, with a tail of 100-150 millimeters. They had rough, orange-brown fur on the dorsal side of their bodies and a lighter color on their undersides. Their long tails ended in a black tuft. Their bodies were narrow and compact, and they had pointed heads with ears like a rabbit's. Their feet and legs, however, were much different from other bandicoot species'. Its forelegs and hindlegs were long and skinny, ending in strangely shaped feet with nails resembling a pig's hoof. On its hindfeet, the second and third toes were fused, and only the fourth was used in locomotion.
Pig-footed bandicoots are believed to have been solitary animals. Depending on their environment, they may have built nests made of grass or dug short tunnels with a nest at the end. These bandicoots lived on the ground and used their keen sense of smell to find food. The most well-documented behavior of Chaeropus ecaudatu was its locomotion. Their movements were often erratic. A slow gait took the form of a bunny hop, while an intermediate gait was a lumbering quadrepedal run with the hind limbs moving alternately. However, Aborigines have reported that the pigfooted bandicoot, if pursued, could reach blazing speeds by breaking into a smooth, galloping sprint.
Little is known about the reproductive cycle of C. ecaudatus, but from studying other bandicoots, it can be inferred that pig-footed bandicoots did not carry more than four young per littler. Females had a strong, sturdy pouch that opened on their backsides. Generally, bandicoots have a short gestation period, around 12 days from conception to birth. Each young weighs about 0.5 grams. When their time in the pouch has ended, baby bandicoots are left in the nest, and around 8-10 days later, they leave with their mother to forage or hunt. Matt Hutchinson was the production editor and copyeditor for Java NIO. Sarah Sherman proofread the book, and Sarah Sherman and Jeffrey Holcomb provided quality control. Angela Howard wrote the index.
Hanna Dyer designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from Animal Creation, Vol. II. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.
Melanie Wang designed the interior layout, based on a series design by David Futato. This book was converted to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Matt Hutchinson.




