Random access a file using File Channel?

460 views Asked by At

When I get FileChannel from FileInputStream, I found I can use position method to freely move file pointer. Does it mean FileChannel provides the functionality of RandomAccessFile?

1

There are 1 answers

0
Lolmewn On

It looks like it's got some of the functionality, this is what RandomAccessFile.getChannel() returns:

The position of the returned channel will always be equal to this object's file-pointer offset as returned by the getFilePointer method.