[jcifs] file pointer wrong after readFully in SMBRandomAccessFile

Richard Heap richardheap at london.com
Tue Feb 26 08:39:21 MST 2013


Hi Mike et al

I believe that the file pointer is being advanced too far following a 
read fully.

For example,
       SmbRandomAccessFile raf = new SmbRandomAccessFile(new 
SmbFile("smb://username:pwd@server/share/foo/bar/file.dat"), "r");
       raf.readFully(new byte[512]);
       System.out.println(raf.getFilePointer());
reads 512 bytes but prints 1024.A subsequent read takes place at 1024 
instead of 512.

It looks like readFully may be incrementing the file pointer as well as 
read(), which is called by readFully, causing a double increment.

Best Regards and thanks again for jcifs.
Richard

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/jcifs/attachments/20130226/30c8026c/attachment.html>


More information about the jCIFS mailing list