title: Reading part of file with BufferedReader
body: <p>I'm trying to write a function that grabs a certain part of a file, sends that to another function, then continue to do the same thing from where the BufferedReader left off  until the end of the file but can't seem to figure out how to make it work.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>String str = "";
  int count = 0; 
  
   try {
    while(//condition so it loops through the entire file. I've tried fileReader.ready() and fileReader.read != -1 but both just run into infinite loops){
  
     while ((count &lt;  4)){ 
      str += fileReader.read();
      count++;
      fileReader.mark(1000);
     }
  
     fileReader.reset();
  
     DoSomething(str) // send str to another function and do something with it;
    }
    } catch (IOException e) {
     // TODO Auto-generated catch block
    }
  </code></pre>
  
  <p>Can someone help me with this and explain what I'm doing wrong? Much would be appreciated</p>