<div dir="ltr">Hi Stefan and Richard,<div><br></div><div style>Not sure why I missed this before. I have added it to the TODO list and gave it a high priority. I don't do releases very often though so it might be a while before it's properly investigated and fixed. But I'll get to it eventually. Thanks for reporting the issue.<br>
<br></div><div style>Mike</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 9, 2013 at 7:48 AM, Stefan Risto <span dir="ltr"><<a href="mailto:risto@web.de" target="_blank">risto@web.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Richard Heap <richardheap <at> <a href="http://london.com" target="_blank">london.com</a>> writes:<br>
<br>
><br>
><br>
>     Hi Mike et alI believe that the file pointer is being<br>
>           advanced too far following a read fully.For example,     <br>
<div class="im">SmbRandomAccessFile raf = new<br>
>                   SmbRandomAccessFile(new<br>
</div>>                                 SmbFile("smb://username:pwd <at><br>
<div class="im">server/share/foo/bar/file.dat"),<br>
>                   "r");<br>
>                         raf.readFully(new byte[512]);<br>
>                         System.out.println(raf.getFilePointer());reads 512<br>
bytes but prints 1024. A subsequent read takes<br>
</div>>                         place at 1024 instead of 512.It looks like<br>
<div class="im">readFully may be<br>
>                           incrementing the file pointer as well as<br>
>                           read(), which is called by<br>
>                           readFully, causing a double increment.Best<br>
Regards and thanks again<br>
>                             for jcifs.Richard<br>
><br>
<br>
<br>
</div>I can confirm this issue. I observed the same behaviour. A workaround for me<br>
is to adjust the file pointer manually after every readFully using seek, but<br>
this is very silly.<br>
Using this workaround I can now open a zip on the smb server and extract a<br>
single file without streaming the whole zip file to the client (I use a<br>
patched version of Apache commons compress' ZipFile for that)<br>
<br>
Please fix that bug so I can get rid of the workaround.<br>
<br>
Regards,<br>
Stefan<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Michael B Allen<br>Java Active Directory Integration<br><a href="http://www.ioplex.com/">http://www.ioplex.com/</a>
</div>