@Test
public void testReadOutOfBoundsOnNotEmptyFile() throws Exception {

   final int fileLength = 8;
   JDBCSequentialFile file = (JDBCSequentialFile) factory.createSequentialFile("test.txt");
   file.open();
   try {
      file.writeDirect(ByteBuffer.allocate(fileLength), true);
      assertEquals(fileLength, file.size());
      file.position(fileLength + 1);
      final ByteBuffer readBuffer = ByteBuffer.allocate(fileLength);
      final int bytes = file.read(readBuffer);
      assertTrue("bytes read should be < 0", bytes < 0);
   } finally {
      file.close();
   }
}