Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "New I/O (JSR 51) Robert Rock Howard Chief Technology Officer Tower Technology."— 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 GCd) –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.


Download ppt "New I/O (JSR 51) Robert Rock Howard Chief Technology Officer Tower Technology."

Similar presentations


Ads by Google