The Artima Developer Community
Sponsored Link

Weblogs Forum
It's time for a new Java I/O API

2 replies on 1 page. Most recent reply: Apr 15, 2006 7:38 AM by Cameron Purdy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Gregg Wonderly

Posts: 317
Nickname: greggwon
Registered: Apr, 2003

It's time for a new Java I/O API (View in Weblogs)
Posted: Apr 5, 2006 1:03 PM
Reply to this message Reply
Summary
We have JSE (J2SE) java.net/java.io, JME (J2ME) connectors and java.nio. It would be great if Dolphin could consolidate things.
Advertisement
In dolphin, the NIO jsr is supposed to finally happen. Some of the things that will happen, reportedly, is that we'll finally have Selector access to files (important in unix where not just files are files). One of the things that continues to bother me is how TCP/IP specific the original Selector implementation is. I'm also bothered by the fact that InputStream and OutputStream didn't become the "channel" of the Selector mechanism.

Instead, we have Selectors that just know about SocketChannels, ServerSocketChannels and the like. Thus to create a new SelectorProvider that might, perhaps provide access to RS232, USB, Bluetooth, or X25 communications paths, you can't really actually use the current Selector implementation because Selector doesn't have much real support for such "device" type protocols.

The JME connector architecture, for me, is much better designed for arbitrary streams. It's more focused on the I/O and less focused on the protocol/transport details. I'm starting to wonder if we shouldn't press the dolphin powers that be to go after a new I/O API for JSE that brings together the connector architure from JME together with a new Selector API thats more focused on generic I/O sources and less focused on the specific sources of I/O.


Howard Lovatt

Posts: 321
Nickname: hlovatt
Registered: Mar, 2003

Re: It's time for a new Java I/O API Posted: Apr 5, 2006 4:16 PM
Reply to this message Reply
Good suggestions

Cameron Purdy

Posts: 186
Nickname: cpurdy
Registered: Dec, 2004

Re: It's time for a new Java I/O API Posted: Apr 15, 2006 7:38 AM
Reply to this message Reply
A close look at even just the .io package shows some fundamental design mistakes, such as the InputStream and OutputStream interfaces being .. um .. classes. This ends up two levels down (with DataInput/DataOutput in the middle) totally uglifying the ObjectInput and ObjectOutput interfaces, which forcibly include the OIS/OOS methods .. not to mention the impossibility of extending DataInputStream/DataOutputStream, which adds its own ugliness.

Flat View: This topic has 2 replies on 1 page
Topic: Where Did All the Beautiful Code Go? Previous Topic   Next Topic Topic: Dynamic Function Overloading

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use