1 / 8

New I/O (JSR 51)

New I/O (JSR 51). Robert “Rock” Howard Chief Technology Officer Tower Technology. New Features. Scalable Network I/O High Performance File I/O Pluggable Characters Sets Character conversion Regular Expressions Features considered but not included: Formatting and scanning

tilly
Download Presentation

New I/O (JSR 51)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. New I/O (JSR 51) Robert “Rock” Howard Chief Technology Officer Tower Technology

  2. New Features • Scalable Network I/O • High Performance File I/O • Pluggable Characters Sets • Character conversion • Regular Expressions • Features considered but not included: • Formatting and scanning • Improved filesystem interface

  3. New Abstractions • Channels • Connections for I/O • Buffers • Containers for primitive data • Charsets (decoders, encoders) • Pattern Matchers • Selectors • Selectable channels

  4. Channels • Defined by interface classes • Reading, writing • Inherit both for bi-directional I/O • Asynchronous Closing and Interruption Defined methods are a grab bag of utilities for buffer manipulation.

  5. Buffers • Based on primitive types • For int, long, float, double, char, etc. • On Heap or else managed directly (not GC’d) • Memory mapped files are allowed • Indexes are managed wrt. # of primitives • Big or little endian hidden in implementation • Nice set of operators for manipulating buffers (reading, writing, managing indices, etc.)

  6. Random Notes: New I/O • Buffer operations return the buffer so that they can be “chained”: • MyIntbuffer.clear().write(17); • Selector allows monitoring of many channels via a single thread • Old I/O unchanged and retained in entirety

  7. Random Notes: JDK 1.4 • The thread stack size can be set via a new Thread constructor • JVMPI and JVMDI (profiling and debugging interfaces) are being replaced • See JSRs for debugging, profiling, monitoring • New “Assert” capability can be enabled • Usage: assert expression ; • Optional Usage: assert expression : error_message ; • Generates AssertionError if triggered • Make sure there are no side effects in assert expression!

  8. Conclusion The new I/O mechanism is sufficiently powerful and scalable that I expect all major commercial Java frameworks to be rewritten for them within 6 to 12 months. The APIs are simple enough that you can pick them up in about one day of concentrated effort. Go For It!

More Related