title: RandomAccessFile - returning null string
body: <p>I have a fixed format file. </p>
  
  <p>I want to access specific lines in this file based on line numbers. </p>
  
  <p>e.g. read line 100</p>
  
  <p>The length of each line is 200 bytes.</p>
  
  <p>So directly moving cursor to 100th line using RandomAccessFile would be like:</p>
  
  <pre><code>File f = new File(myFile);
  RandomAccessFile r = new RandomAccessFile(f,"rw");
  r.skipBytes(200 * 99);   // linesize * (lineNum - 1)
  System.out.println(r.readLine());
  </code></pre>
  
  <p>However, I am getting output as null.</p>
  
  <p>What am I missing here ?</p>
  
  <p>The question is in continuation to answer to my previous question <a href="https://stackoverflow.com/q/9769874/887235">Reaching a specific line in a file using RandomAccessFile</a></p>
  
  <p><strong>Update:</strong></p>
  
  <p>Below program works exactly as I am expecting:</p>
  
  <p>Line size is 200 characters.</p>
  
  <pre><code>File f = new File(myFile);
  RandomAccessFile r = new RandomAccessFile(f,"rw");
  r.seek(201 * (lineNumber-1));   // linesize * (lineNum - 1)
  System.out.println(r.readLine());
  </code></pre>
  
  <p>Giving linenumber (any line number from entire file) is printing that line.</p>
  
  <p>@EJP: Please explain!</p>