[ https://issues.apache.org/jira/browse/CASSANDRA-2213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997970#comment-12997970 ]
Hudson commented on CASSANDRA-2213: ----------------------------------- Integrated in Cassandra-0.7 #304 (See [https://hudson.apache.org/hudson/job/Cassandra-0.7/304/]) avoid EOFing on requests for the last bytes in a file patch by Leo Jay; reviewed by jbellis for CASSANDRA-2213 > A bug in BufferedRandomAccessFile > --------------------------------- > > Key: CASSANDRA-2213 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2213 > Project: Cassandra > Issue Type: Bug > Affects Versions: 0.7.2 > Reporter: Leo Jay > Assignee: Leo Jay > Fix For: 0.7.3 > > > The first line of BufferedRandomAccessFile.readAtMost is > {code}if (length >= bufferEnd && hitEOF){code} > I think It should be ">" instead of ">=", > Here is a test for this:{code} > @Test > public void testRead() throws IOException { > File tmpFile = File.createTempFile("readtest", "bin"); > tmpFile.deleteOnExit(); > // Create the BRAF by filename instead of by file. > BufferedRandomAccessFile rw = new > BufferedRandomAccessFile(tmpFile.getPath(), "rw"); > rw.write(new byte[] {1}); > rw.seek(0); > byte[] buffer = new byte[1]; > assert rw.read(buffer) == 1; > assert buffer[0] == 1; > } > {code} -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira