title: Use BufferedReader and InputStream together
body: <p>I use a BufferedReader to read lines from an InputStream. When I read something directly from the InputStream, the BufferedReader ignores my read and continues reading at the same location. Is it possible to prevent this behavior? If not what is a good practice to do this?</p>
  
  <p>PS: Here's my code:</p>
  
  <pre><code>byte[] ba = new byte[1024*1024];
  int off = 0;
  int len = 0;
  do {
      len = Integer.parseInt(br.readLine());
      in.read(ba, off, len);
      br.readLine();
      off += len;
  } while(len &gt; 0);
  </code></pre>
  
  <p><code>in</code> is my inputstream and <code>br</code> my bufferedreader.</p>