چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

Java NIO

Ron Hitchens

قیمت نهایی

۴۴٬۰۰۰ تومان۴۹٬۰۰۰ تومان۱۰٪ تخفیف
  • تخفیف زمان‌دار−۵٬۰۰۰ تومان

۵٬۰۰۰ تومان صرفه‌جویی نسبت به قیمت اصلی

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

نویسنده
Ron Hitchens
سال انتشار
۲۰۰۲
فرمت
PDF
زبان
انگلیسی
تعداد صفحات
۲۸۲ صفحه
حجم فایل
۱٫۵ مگابایت

دربارهٔ کتاب

Actually the small subtitle on the top of the front page "Regular Expressions and High-Performance I/O" would be the better title. "Java NIO" is incorrect. That suggest already that the mere 282 pages are not completely devoted to explaining usage of NIO package. The obvious conclusion is that this book is to terse to grant it the status of the sole source of information on NIO. But wait, there is more: The author feels the necessity to quote the Java package specifications, which we all have anyways on the net. This nonsensical waste of paper starts on the page 238, preceded by several pages of a similarly useless appendix B which quotes java.nio.channels.spi specifications. Thus the book has de facto approx. 230 pages. But wait, there is more! Already on the page 151 author abandons NIO and devotes himself to a talk about regular expression package, and... in his code examples uses boldly standard java.io. His examples are of a stunning banality and simplicity, to terse to be of any use beyond the regular Java instructional trail on the net. Regarding NIO, the 150 pages remaining, reader should rather take a look at "The JDK 1.4 Tutorial", 408 pages: The JDK 1.4 Tutorial. Travis'es chapter 1 and 2 clearly top this text in every aspect. Hitchens code examples seem very arbitrary, and often to verbose, dealing with, or constructing something not pertinent to IO itself. For example, pages 63/65, where author suggest to "wait" in a spinning while loop for write, without any sleep (hm..., is that really necessary?) and later on wastes an entire page on assembling some arbitrary text messages or sentences of a kind. Every reader will make many more such observations. Not a good call on O'Reilly's part... NIO is very complex indeed, and every practitioner has his/her own set of papers and snippets collected over the time, still waiting for "the ultimate" summary by someone. Last but not least, what annoys me in this book are the nonsensical and banal quotes of someone or something in the beginning of the chapters. This is a very nasty habit, copied over and over again by many authors. Only a few writers have the knowledge and ability to make such quotes, see Donald Knuth to contrast what you will find in this book. For example, "here, put this fish in you ear" by Ford Prefect. I have no clue what that means, and who or what Ford Prefect was. The said appendix with cut-and-paste of Java package specifications starts with a sentence by "U2", what ever that means. The equally useless appendix B starts with "If you build it, he will come" by... "An Iowa cornfield"! I have really no words to comment on this nonsense. Now let me pack the "NIO users manual" and ship it back to Amazon. Give me my money back! Table of Content 2 Dedication 3 Preface 4 Organization 5 Who Should Read This Book 7 Software and Versions 8 Conventions Used in This Book 8 Font Conventions 9 How to Contact Us 10 Acknowledgments 11 Chapter 1. Introduction 13 1.1 I/O Versus CPU Time 13 13 Table?1-1. Throughput rate, processing versus I/O time 13 1.2 No Longer CPU Bound 14 1.3 Getting to the Good Stuff 15 1.4 I/O Concepts 16 1.4.1 Buffer Handling 16 Figure 1-1. Simplified I/O buffer handling 17 1.4.1.1 Scatter/gather 18 Figure 1-2. A scattering read to three buffers 18 1.4.2 Virtual Memory 18 Figure 1-3. Multiply mapped memory space 18 Figure 1-4. Memory pages 19 1.4.3 Memory Paging 19 Figure 1-5. Physical memory as a paging-area cache 19 1.4.4 File I/O 20 1.4.4.1 Memory-mapped files 22 Figure 1-6. User memory mapped to filesystem pages 22 1.4.4.2 File locking 23 Figure 1-7. Exclusive-lock request blocked by shared locks 23 Figure 1-8. Shared-lock requests blocked by exclusive lock 24 1.4.5 Stream I/O 24 1.5 Summary 25 Chapter 2. Buffers 26 26 26 Figure 2-1. The Buffer family tree 26 2.1 Buffer Basics 27 2.1.1 Attributes 27 Figure 2-2. A newly created ByteBuffer 28 2.1.2 Buffer API 28 2.1.3 Accessing 29 2.1.4 Filling 30 Figure 2-3. Buffer after five put()s 30 Figure 2-4. Buffer after modification 31 2.1.5 Flipping 31 Figure 2-5. Buffer after being flipped 31 2.1.6 Draining 32 Example 2-1. Filling and draining buffers 33 2.1.7 Compacting 34 Figure 2-6. A partially drained buffer 34 Figure 2-7. Buffer after compaction 34 2.1.8 Marking 35 Figure 2-8. A buffer with a mark set 35 Figure 2-9. A buffer position reset to its mark 36 2.1.9 Comparing 36 Figure 2-10. Two buffers considered to be equal 37 Figure 2-11. Two buffers considered to be unequal 37 2.1.10 Bulk Moves 38 2.2 Creating Buffers 41 2.3 Duplicating Buffers 44 45 Figure 2-12. Duplicating a buffer 45 Figure 2-13. Creating a slice buffer 45 2.4 Byte Buffers 46 2.4.1 Byte Ordering 48 Table?2-1. Primitive data types and sizes 48 Figure 2-14. Big-endian byte order 48 Figure 2-15. Little-endian byte order 49 2.4.2 Direct Buffers 51 2.4.3 View Buffers 52 Figure 2-16. A CharBuffer view of a ByteBuffer 53 Example 2-2. Creating a char view of a ByteBuffer 54 2.4.4 Data Element Views 55 Figure 2-17. A ByteBuffer containing some data 56 2.4.5 Accessing Unsigned Data 57 Example 2-3. Utility routines for getting/putting unsigned values 57 2.4.6 Memory-Mapped Buffers 59 2.5 Summary 59 Chapter 3. Channels 61 61 61 Figure 3-1. Channels act as conduits to I/O services 61 Figure 3-2. The channel family tree 62 3.1 Channel Basics 62 3.1.1 Opening Channels 64 3.1.2 Using Channels 64 Figure 3-3. The ByteChannel interfaces 65 Example 3-1. Copying data between channels 66 3.1.3 Closing Channels 68 3.2 Scatter/Gather 70 71 Figure 3-4. Scatter/gather interfaces 71 Figure 3-5. A gathering write using four buffers 72 Figure 3-6. A scattering read using four buffers 72 Example 3-2. Collecting many buffers in a gathering write 73 3.3 File Channels 75 76 Figure 3-7. FileChannel family tree 76 3.3.1 Accessing Files 78 Table?3-1. File I/O API comparison chart 78 Figure 3-8. A disk file with two holes 82 3.3.2 File Locking 83 Example 3-3. Shared- and exclusive-lock interaction 86 3.4 Memory-Mapped Files 89 94 Example 3-4. Composing HTTP replies with mapped files and gathering writes 94 Example 3-5. Three types of memory-mapped buffers 96 3.4.1 Channel-to-Channel Transfers 99 Example 3-6. File concatenation using channel transfer 100 3.5 Socket Channels 101 102 Figure 3-9. The socket channel family tree 102 3.5.1 Nonblocking Mode 103 3.5.2 ServerSocketChannel 105 Example 3-7. A nonblocking accept() with ServerSocketChannel 106 3.5.3 SocketChannel 107 Example 3-8. Concurrent-connection establishment 109 3.5.4 DatagramChannel 111 Example 3-9. Time-service client using DatagramChannel 115 Example 3-10. DatagramChannel time server 119 3.6 Pipes 121 121 Figure 3-10. The Pipe family tree 121 Figure 3-11. A pipe is a pair of looped channels 123 Example 3-11. Worker thread writing to a pipe 124 3.7 The Channels Utility Class 126 126 Table?3-2. Summary of java.nio.channels.Channels utility methods 126 3.8 Summary 127 Chapter 4. Selectors 129 4.1 Selector Basics 129 4.1.1 The Selector, SelectableChannel, and SelectionKey Classes 131 Figure 4-1. Selection class family tree 132 Figure 4-2. Relationships of the selection classes 134 4.1.2 Setting Up Selectors 136 4.2 Using Selection Keys 138 4.3 Using Selectors 142 4.3.1 The Selection Process 142 4.3.2 Stopping the Selection Process 145 4.3.3 Managing Selection Keys 146 Example 4-1. Using select() to service multiple channels 147 4.3.4 Concurrency 151 4.4 Asynchronous Closability 152 4.5 Selection Scaling 152 153 Example 4-2. Servicing channels with a thread pool 153 4.6 Summary 158 Chapter 5. Regular Expressions 160 160 160 Figure 5-1. The regular expression classes 160 5.1 Regular Expression Basics 160 5.2 The Java Regular Expression API 163 5.2.1 The CharSequence Interface 163 Example 5-1. CharSequence interface examples 164 5.2.2 The Pattern Class 165 Table?5-1. Flag values affecting regular expression compilation 167 Table?5-2. Matrix of split() behavior 169 5.2.2.1 Splitting strings with the Pattern class 170 Example 5-2. Splitting strings with Pattern 170 Example 5-3. Split matrix styelsheet 172 5.2.3 The Matcher Class 173 Example 5-4. Simple file grep 174 Example 5-5. Extracting matched expressions 175 Figure 5-2. start(), end(), and group() values 177 Table?5-3. Regular expression capture groups of A((B)(C(D))) 178 Table?5-4. Replacement of matched patterns 180 Example 5-6. Regular expression replacement 180 Example 5-7. Backslashes in regular expressions 182 Table?5-5. Using appendReplacement() and appendTail() 184 Example 5-8. Regular expression append/replace 184 5.3 Regular Expression Methods of the String Class 185 186 Table?5-6. Regular expression methods of the String class 186 5.4 Java Regular Expression Syntax 186 187 Table?5-7. Java regular expression syntax quick reference 187 5.5 An Object-Oriented File Grep 190 190 Example 5-9. Object-oriented grep 190 5.6 Summary 196 Chapter 6. Character Sets 198 6.1 Character Set Basics 198 199 Figure 6-1. Characters encoded as UTF-8 199 6.2 Charsets 200 200 Table?6-1. Required charsets 200 Table?6-2. UTF-16 charset encode/decode 201 Example 6-1. Encoding with the standard charsets 201 6.2.1 The Charset Class 205 Figure 6-2. The charset classes 205 6.2.2 Comparing Charsets 208 6.2.3 Charset Encoders 209 6.2.3.1 The CoderResult class 215 Table?6-3. Exceptions thrown by CoderResult.throwException() 217 6.2.4 Charset Decoders 217 Example 6-2. Charset decoding 219 6.3 The Charset Service Provider Interface 222 222 Table?6-4. Legal characters for charset names 222 6.3.1 Creating Custom Charsets 223 6.3.2 Providing Your Custom Charsets 226 Example 6-3. The custom Rot13 charset 229 Example 6-4. Custom charset provider 233 6.4 Summary 235 Appendix A. NIO and the JNI 237 Appendix B. Selectable Channels SPI 240 Appendix C. NIO Quick Reference 243 C.1 Package java.nio 243 C.1.1 Buffer 243 C.1.2 BufferOverflowException 244 C.1.3 BufferUnderflowException 244 C.1.4 ByteBuffer 244 C.1.5 ByteOrder 245 C.1.6 CharBuffer 246 C.1.7 DoubleBuffer 247 C.1.8 FloatBuffer 247 C.1.9 IntBuffer 248 C.1.10 InvalidMarkException 249 C.1.11 LongBuffer 249 C.1.12 MappedByteBuffer 250 C.1.13 ReadOnlyBufferException 250 C.1.14 ShortBuffer 250 C.2 Package java.nio.channels 251 C.2.1 AlreadyConnectedException 251 C.2.2 AsynchronousCloseException 251 C.2.3 ByteChannel 252 C.2.4 CancelledKeyException 252 C.2.5 Channel 252 C.2.6 Channels 252 C.2.7 ClosedByInterruptException 253 C.2.8 ClosedChannelException 253 C.2.9 ClosedSelectorException 254 C.2.10 ConnectionPendingException 254 C.2.11 DatagramChannel 254 C.2.12 FileChannel 255 C.2.13 FileLock 256 C.2.14 FileLockInterruptionException 256 C.2.15 GatheringByteChannel 257 C.2.16 IllegalBlockingModeException 257 C.2.17 IllegalSelectorException 257 C.2.18 InterruptibleChannel 258 C.2.19 NoConnectionPendingException 258 C.2.20 NonReadableChannelException 258 C.2.21 NonWritableChannelException 258 C.2.22 NotYetBoundException 259 C.2.23 NotYetConnectedException 259 C.2.24 OverlappingFileLockException 259 C.2.25 Pipe 260 C.2.26 ReadableByteChannel 260 C.2.27 ScatteringByteChannel 260 C.2.28 SelectableChannel 261 C.2.29 SelectionKey 261 C.2.30 Selector 262 C.2.31 ServerSocketChannel 262 C.2.32 SocketChannel 263 C.2.33 UnresolvedAddressException 263 C.2.34 UnsupportedAddressTypeException 264 C.2.35 WritableByteChannel 264 C.3 Package java.nio.channels.spi 264 C.3.1 AbstractInterruptibleChannel 264 C.3.2 AbstractSelectableChannel 265 C.3.3 AbstractSelectionKey 265 C.3.4 AbstractSelector 265 C.3.5 SelectorProvider 266 C.4 Package java.nio.charset 266 C.4.1 CharacterCodingException 266 C.4.2 Charset 267 C.4.3 CharsetDecoder 267 C.4.4 CharsetEncoder 268 C.4.5 CoderMalfunctionError 269 C.4.6 CoderResult 269 C.4.7 CodingErrorAction 269 C.4.8 IllegalCharsetNameException 270 C.4.9 MalformedInputException 270 C.4.10 UnmappableCharacterException 270 C.4.11 UnsupportedCharsetException 271 C.5 Package java.nio.charset.spi 271 C.5.1 CharsetProvider 271 C.6 Package java.util.regex 271 C.6.1 Matcher 271 C.6.2 Pattern 272 C.6.3 PatternSyntaxException 273 Colophon 273 Table of Content......Page 2 Dedication......Page 3 Preface......Page 4 Organization......Page 5 Who Should Read This Book......Page 7 Conventions Used in This Book......Page 8 Font Conventions......Page 9 How to Contact Us......Page 10 Acknowledgments......Page 11 Table?1-1. Throughput rate, processing versus I/O time......Page 13 1.2 No Longer CPU Bound......Page 14 1.3 Getting to the Good Stuff......Page 15 1.4.1 Buffer Handling......Page 16 Figure 1-1. Simplified I/O buffer handling......Page 17 Figure 1-3. Multiply mapped memory space......Page 18 Figure 1-5. Physical memory as a paging-area cache......Page 19 1.4.4 File I/O......Page 20 Figure 1-6. User memory mapped to filesystem pages......Page 22 Figure 1-7. Exclusive-lock request blocked by shared locks......Page 23 1.4.5 Stream I/O......Page 24 1.5 Summary......Page 25 Figure 2-1. The Buffer family tree......Page 26 2.1.1 Attributes......Page 27 2.1.2 Buffer API......Page 28 2.1.3 Accessing......Page 29 Figure 2-3. Buffer after five put()s......Page 30 Figure 2-5. Buffer after being flipped......Page 31 2.1.6 Draining......Page 32 Example 2-1. Filling and draining buffers......Page 33 Figure 2-7. Buffer after compaction......Page 34 Figure 2-8. A buffer with a mark set......Page 35 2.1.9 Comparing......Page 36 Figure 2-11. Two buffers considered to be unequal......Page 37 2.1.10 Bulk Moves......Page 38 2.2 Creating Buffers......Page 41 2.3 Duplicating Buffers......Page 44 Figure 2-13. Creating a slice buffer......Page 45 2.4 Byte Buffers......Page 46 Figure 2-14. Big-endian byte order......Page 48 Figure 2-15. Little-endian byte order......Page 49 2.4.2 Direct Buffers......Page 51 2.4.3 View Buffers......Page 52 Figure 2-16. A CharBuffer view of a ByteBuffer......Page 53 Example 2-2. Creating a char view of a ByteBuffer......Page 54 2.4.4 Data Element Views......Page 55 Figure 2-17. A ByteBuffer containing some data......Page 56 Example 2-3. Utility routines for getting/putting unsigned values......Page 57 2.5 Summary......Page 59 Figure 3-1. Channels act as conduits to I/O services......Page 61 3.1 Channel Basics......Page 62 3.1.2 Using Channels......Page 64 Figure 3-3. The ByteChannel interfaces......Page 65 Example 3-1. Copying data between channels......Page 66 3.1.3 Closing Channels......Page 68 3.2 Scatter/Gather......Page 70 Figure 3-4. Scatter/gather interfaces......Page 71 Figure 3-6. A scattering read using four buffers......Page 72 Example 3-2. Collecting many buffers in a gathering write......Page 73 3.3 File Channels......Page 75 Figure 3-7. FileChannel family tree......Page 76 Table?3-1. File I/O API comparison chart......Page 78 Figure 3-8. A disk file with two holes......Page 82 3.3.2 File Locking......Page 83 Example 3-3. Shared- and exclusive-lock interaction......Page 86 3.4 Memory-Mapped Files......Page 89 Example 3-4. Composing HTTP replies with mapped files and gathering writes......Page 94 Example 3-5. Three types of memory-mapped buffers......Page 96 3.4.1 Channel-to-Channel Transfers......Page 99 Example 3-6. File concatenation using channel transfer......Page 100 3.5 Socket Channels......Page 101 Figure 3-9. The socket channel family tree......Page 102 3.5.1 Nonblocking Mode......Page 103 3.5.2 ServerSocketChannel......Page 105 Example 3-7. A nonblocking accept() with ServerSocketChannel......Page 106 3.5.3 SocketChannel......Page 107 Example 3-8. Concurrent-connection establishment......Page 109 3.5.4 DatagramChannel......Page 111 Example 3-9. Time-service client using DatagramChannel......Page 115 Example 3-10. DatagramChannel time server......Page 119 Figure 3-10. The Pipe family tree......Page 121 Figure 3-11. A pipe is a pair of looped channels......Page 123 Example 3-11. Worker thread writing to a pipe......Page 124 Table?3-2. Summary of java.nio.channels.Channels utility methods......Page 126 3.8 Summary......Page 127 4.1 Selector Basics......Page 129 4.1.1 The Selector, SelectableChannel, and SelectionKey Classes......Page 131 Figure 4-1. Selection class family tree......Page 132 Figure 4-2. Relationships of the selection classes......Page 134 4.1.2 Setting Up Selectors......Page 136 4.2 Using Selection Keys......Page 138 4.3.1 The Selection Process......Page 142 4.3.2 Stopping the Selection Process......Page 145 4.3.3 Managing Selection Keys......Page 146 Example 4-1. Using select() to service multiple channels......Page 147 4.3.4 Concurrency......Page 151 4.5 Selection Scaling......Page 152 Example 4-2. Servicing channels with a thread pool......Page 153 4.6 Summary......Page 158 5.1 Regular Expression Basics......Page 160 5.2.1 The CharSequence Interface......Page 163 Example 5-1. CharSequence interface examples......Page 164 5.2.2 The Pattern Class......Page 165 Table?5-1. Flag values affecting regular expression compilation......Page 167 Table?5-2. Matrix of split() behavior......Page 169 Example 5-2. Splitting strings with Pattern......Page 170 Example 5-3. Split matrix styelsheet......Page 172 5.2.3 The Matcher Class......Page 173 Example 5-4. Simple file grep......Page 174 Example 5-5. Extracting matched expressions......Page 175 Figure 5-2. start(), end(), and group() values......Page 177 Table?5-3. Regular expression capture groups of A((B)(C(D)))......Page 178 Example 5-6. Regular expression replacement......Page 180 Example 5-7. Backslashes in regular expressions......Page 182 Example 5-8. Regular expression append/replace......Page 184 5.3 Regular Expression Methods of the String Class......Page 185 5.4 Java Regular Expression Syntax......Page 186 Table?5-7. Java regular expression syntax quick reference......Page 187 Example 5-9. Object-oriented grep......Page 190 5.6 Summary......Page 196 6.1 Character Set Basics......Page 198 Figure 6-1. Characters encoded as UTF-8......Page 199 Table?6-1. Required charsets......Page 200 Example 6-1. Encoding with the standard charsets......Page 201 Figure 6-2. The charset classes......Page 205 6.2.2 Comparing Charsets......Page 208 6.2.3 Charset Encoders......Page 209 6.2.3.1 The CoderResult class......Page 215 6.2.4 Charset Decoders......Page 217 Example 6-2. Charset decoding......Page 219 Table?6-4. Legal characters for charset names......Page 222 6.3.1 Creating Custom Charsets......Page 223 6.3.2 Providing Your Custom Charsets......Page 226 Example 6-3. The custom Rot13 charset......Page 229 Example 6-4. Custom charset provider......Page 233 6.4 Summary......Page 235 Appendix A. NIO and the JNI......Page 237 Appendix B. Selectable Channels SPI......Page 240 C.1.1 Buffer......Page 243 C.1.4 ByteBuffer......Page 244 C.1.5 ByteOrder......Page 245 C.1.6 CharBuffer......Page 246 C.1.8 FloatBuffer......Page 247 C.1.9 IntBuffer......Page 248 C.1.11 LongBuffer......Page 249 C.1.14 ShortBuffer......Page 250 C.2.2 AsynchronousCloseException......Page 251 C.2.6 Channels......Page 252 C.2.8 ClosedChannelException......Page 253 C.2.11 DatagramChannel......Page 254 C.2.12 FileChannel......Page 255 C.2.14 FileLockInterruptionException......Page 256 C.2.17 IllegalSelectorException......Page 257 C.2.21 NonWritableChannelException......Page 258 C.2.24 OverlappingFileLockException......Page 259 C.2.27 ScatteringByteChannel......Page 260 C.2.29 SelectionKey......Page 261 C.2.31 ServerSocketChannel......Page 262 C.2.33 UnresolvedAddressException......Page 263 C.3.1 AbstractInterruptibleChannel......Page 264 C.3.4 AbstractSelector......Page 265 C.4.1 CharacterCodingException......Page 266 C.4.3 CharsetDecoder......Page 267 C.4.4 CharsetEncoder......Page 268 C.4.7 CodingErrorAction......Page 269 C.4.10 UnmappableCharacterException......Page 270 C.6.1 Matcher......Page 271 C.6.2 Pattern......Page 272 Colophon......Page 273 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 NIOBasic and advanced I/O ConceptsBinary I/O and the new buffer classesMemory mapped files and file lockingCharacter I/O: encoding, decoding and transforming character dataRegular Expressions and the new java.util.regex packageMuliplexing with java.nioBecause 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. The Java New I/O (NIO) packages in J2SE 1.4 introduce many new, indispensable features previously unavailable to Java programmers. These include APIs for high-performance I/O operations, regular expression processing, and character set coding. These new libraries are a treasure trove for Java developers. The NIO APIs are especially valuable where high-performance I/O is a requirement, but they can also be useful in a wide range of scenarios. The new APIs let you work directly with I/O buffers, multiplex nonblocking streams, do scattering reads and gathering writes, do channel-to-channel transfers, work with memory-mapped files, manage file locks, and much more. The new high-performance Regular Expression Library provides sophisticated, Perl-like regex-processing features such as pattern matching, search and replace, capture groups, look-ahead assertions, and many others. The Charset API gives you complete control over character set encoding and decoding, which are vital for properly managing the exchange of documents on the Web, for localization, or for other purposes. You can also create and install your own custom character sets.Staying current with the latest Java technology is never easy. NIO, new in Java 1.4, is quite possibly the most important new Java feature since Swing. Understanding it thoroughly is essential for any serious Java developer. NIO closes the gap between Java and natively compiled languages and enables Java applications to achieve maximum I/O performance by effectively leveraging operating-system services in a portable way. Java NIO is a comprehensive guide to the Java New I/O facilities. It lets you take full advantage of NIO features and shows you how they work, what they can do for you, and when you should use them. This book brings you up to speed on NIO and shows you how to bring your I/O-bound Java applications up to speed as well. Java NIO is an essential part of any Java professional's library. 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. 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. 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.

قیمت نهایی

۴۴٬۰۰۰ تومان