[jcifs] SmbFile access via SeekableByteChannel

Michael B Allen ioplex at gmail.com
Tue Oct 1 00:34:13 MDT 2013


On Wed, Sep 18, 2013 at 8:27 AM, Jan Schlößin
<jan.schloessin at incasoft.de> wrote:
> Hello,
>
> I would like to have access to a file via a ByteChannel for more
> flexibility. As far as I understand the cifs protocol there can be an
> efficient implementation of a read/write access pattern within one file.
>
> Is it planned in SmbFile to migrate from Input-/OutputStream to
> SeekableByteChannel? Can I contribute? What challenges will we meet?

Hi Jan,

JCIFS does not use NIO because the only really useful thing that NIO
provides is I/O multiplexing but that is not an obvious benefit to a
client. A client can multiplex IO very well with a Thread for each
client socket (as JCIFS does now) and it is not likely that a client
would want to create more than a few sockets.

Also, it does not help that the NIO package is a ugly over-designed
interface (think JNDI). If everyone used NIO then we might have to
play along just for the sake of polymorphism and such. But for now I
will be avoiding NIO like flesh eating bacteria.

But I could be wrong (it has happened before). If you feel strongly
that you have something to contribute, create a new JCIFS package with
your modifications and post it into github or similar where people can
download it and try it.

Note that SmbRandomAccessFile is fairly close to what SeekableByteChannel does.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/


More information about the jCIFS mailing list