How to get FileChannel from resource

Xueming Shen Xueming.Shen at Sun.COM
Mon Mar 2 07:50:26 UTC 2009

You can use java.nio.channels.Channels.newChannel()  to get a 
ReadableByteChannel on top of the
InputStream you get from URL.openStream()...

but if my guess of what you want to do is correct, that channel is 
probably not that useful:-)


Ulf Zibis wrote:
> Hi all
> there is a { URL getResource(String name) } in class Class.
> Does anybody know, how to get a java.nio.channels.Channel or 
> FileChannel from this URL?
> Thanks in advance,
> -Ulf

More information about the core-libs-dev mailing list