FileChannel
Alan Bateman
Alan.Bateman at Sun.COM
Sun May 3 01:33:57 PDT 2009
Marc Petit-Huguenin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Is there a reason why FileChannel does not extend
> AbstractSelectableChannel in JDK7? I think that it would make sense
> now that there is a AsynchronousFileChannel implementation.
>
> AFAIK the change would not break compatibility.
>
> Thanks.
>
FileChannel is intentionally not a SelectableChannel. In many cases it
doesn't make sense to try to multiplex I/O with files because they are
always ready for reading and writing. On other platforms it just isn't
feasible because file I/O cannot be multiplexed. A future complication
is that selectable channels are tied to a selector provider and so can
be replaced independently of the file system provider. In jdk7, the file
system provider is the factory for both FileChannels and
AsynchronousFileChannels.
-Alan.
More information about the nio-discuss
mailing list