jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: Initial draft of NIO proposal

From: Greg Wilkins <gregw_at_intalio.com>
Date: Thu, 15 Sep 2011 10:17:22 +1000

On 15 September 2011 02:40, Shing Wai Chan <shing.wai.chan_at_oracle.com> wrote:
> Note that in JDK 7, AsynchronousByteChannel, besides method similar to
> above, we have
> <A> void read(ByteBuffer dst, A attachment, CompletionHandler<Integer, ?
> super A> handler)

Indeed.

The future style is really an alternative to the
InputSource/OutputSink methods that allow enquiries about completion.
The style of passing in a completion handler for a specific IO
operation is an alternative to registering a listener for IO events.

I think there is merit in considering an API that is as close to both
java7 styles as possible - even though both require preallocation of
buffers (perhaps that is also fixable).

cheers