AsynchrronousByteChannelvsAsynchronousFileChannelandAsynchronousTransmitter

Alexander Libman libman at terabit.com.au
Tue May 12 22:48:37 PDT 2009


Hi Alan,

> The channels package needs to stayed focused on file and network I/O.

Sure, agree.

> While interfaces to facilitate higher level asynchronous operations are
> nice, they probably should be in a higher level framework or other
> layered API.

No objections that low level package should not have
any special features designed for specific high-level packages like
filters,etc..


I see only one reason why generic "AsynchronousByteChannel"  can create
later a problem:

My point was that the following two schemas are equivalent :

interface A {  X  f(Y); }

and

interface GenericA<T1,T2>   {  T1 f(T2); }
interface A extends GenericA<X,Y>  { }

But  Java implements templates as generics (not as C++ templates)
and following does not work:
    interface A<T1,T2> { T1 f(T2 a); }
    interface B extends A<Integer, Integer> {}
    interface C extends A<Long, Long> {}
    interface D extends B, C {}

Yes, agree with you.




More information about the nio-dev mailing list