6963828: TEST_BUG: java/nio/channels/FileTransfer.java takes too long (win)

Rémi Forax forax at univ-mlv.fr
Thu Jun 24 06:25:24 PDT 2010


Le 24/06/2010 14:45, Alan Bateman a écrit :
> Rémi Forax wrote:
>> :
>> Alan, is there a way to create a RandomAccessFile form a Path ?
> Not directly so it requires using the String representation, eg:
>
>  Path file = ..
>  RandomAccessFile raf = new RandomAccessFile(file.toString(), "rw")
>
> -Alan.

It seems there is no way to directly create a FileChannel from a Path.
You have to convert the path to a string, create a 
FileInputStream/FileOutputStream
or a RandomAccessFile and called getChannel on it.

Rémi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20100624/1bc70d8c/attachment.html 


More information about the nio-dev mailing list