title: Buffered Input Stream mark read limit
body: <p>I am learning how to use an InputStream. I was trying to use mark for BufferedInputStream, but when I try to reset I have these exceptions:</p>
  
  <pre><code>java.io.IOException: Resetting to invalid mark
  </code></pre>
  
  <p>I think this means that my mark read limit is set wrong. I actually don't know how to set the read limit in mark(). I tried like this:</p>
  
  <pre><code>is = new BufferedInputStream(is);
  is.mark(is.available());
  </code></pre>
  
  <p>This is also wrong. </p>
  
  <pre><code>is.mark(16);
  </code></pre>
  
  <p>This also throws the same exception.
  How do I know what read limit I am supposed to set? Since I will be reading different file sizes from the input stream. </p>