title: Looping over InputStream truncating data
body: <p>So this is a very simple problem with a simple solution that I'm just not seeing:</p>
  
  <p>I'm trying to get a list of data through an InputStream, looping until I reach the end of the stream. On each iteration, I print the next line of text being passed through the InputStream. I have it working but for one small problem: I'm truncating the first character of each line.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>while (dataInputStream.read() &gt;= 0) {
      System.out.printf("%s\n", dataInputReader.readLine());
  }
  </code></pre>
  
  <p>And the output:</p>
  
  <pre><code>classpath
  project
  est.txt
  </code></pre>
  
  <p>Now, I know what's going on here: the <code>read()</code> call in my <code>while</code> loop is taking the first char on each line, so when the line gets passed into the loop, that char is missing. The problem is, I can't figure out how to set up a loop to prevent that.</p>
  
  <p>I think I just need a new set of eyes on this.</p>