FileChannel.open(path)
方法返回什么样的FileChannel
对象?RandomAccessFile vs FileChannel.open(path);
它仍然是随机访问允许,就像它是如下?
RandomAccessFile ra = new RandomAccessFile("RandomIndeed","rw");
FileChannel fc1 = ra.getChannel();
什么是和下面的实例fc
fc1
之间的区别:
FileChannel fc = FileChannel.open(path);
基本上我想知道会有怎样的两个对象之间的差异上面创建的,因此fc1
和fc
在此先感谢。
两个调用(至少对于Unix文件系统)都返回相同的对象(sun.nio.ch.FileChannelImpl)。 – Perception 2013-05-09 15:32:09