FSFile & ByteBuffer

Hi all,

I want to replace the read & write methods of FSFile & BlockDeviceAPI with versions that read & write from/to ByteBuffer's.
The reasons for this is that it will fit much closer to the current state of classpath and it will help in making the performance of the FS implementation better.

Does anyone see any problems with this?


BlockDeviceAPI, ByteBuffer and Channel

Why not trying to do it at a deeper level (closer to hardware) ?

As I was trying to understand the nio philosophy, I found in the javadoc for the Channel interface :

    A channel represents an open connection to an entity such as a hardware device,(...)

And I realized that BlockDeviceAPI may have its own Channel implementation (we can call it DeviceChannel) that do its read/write operations through a ByteBuffer.

As for FileChannel, this can allow use to lock a part of the device (or all of it) for example if we are doing a defragmentation of the file system or formatting the device.
The methods FileChannel.force and FileChannel.map may also be usefull in the case of device.

What do you think of this idea ?


Seems like a good idea to

Seems like a good idea to me.

This might seams a little lam

This might seams a little lame, but I'm from the old java school(started back with the 1.02) and have really not worked that much with the "new" java.nio package and would very like to see an example used in JNode. I think it's ok, that you replace the read and write methodes so that they use ByteBuffers.