Ulf Zibis wrote:


Anyway, I'm looking for a DirectBuffer directly from a resource file.
So I think there is something missing:
URL.openChannel() or Class#getResourceAsChannel()

Maybe there is a way to get a RamdomAccessFile from URL to get the Channel from. Anybody knows ?

If it's a file URL, then obviously you can check the protocol and create a `File` from the file portion. However most resources are not stored in naked files.

For jared resources, you can cast the URLConnection to JarURLConnection and call getJarFile. Some implementations of JarURLConnection may not return a JarFile.

Tom Hawtin

Reply via email to