If the EnhancedRandomAccessFile ever reaches the end of the file, an instance
boolean called 'endOfFile' is set true to allow faster determination of end of
file than comparison with long pointer values that are not always easily
derived. That's fine. However, once the value becomes true, if the user seeks
backward in the file a small distance such that the seek is within the currently
buffered portion of the file, then the endOfFile bit is not reset.
The following patch is an 'svn diff' from the root of the streams module. It
resolves the issue by clearing endOfFile when seeking to a file position within
the loaded buffer:
@@ -300,6 +300,7 @@
// If the seek is into the buffer, just update the eraf pointer.
if ((pos >= bufferStart) && (pos < dataEnd))
Please let me know if I can do anything else to speed along the inclusion of
this patch. Thanks! -Eric