title: java.io.IOException: Mark has been invalidated when parsing website with jsoup
body: <p>When trying parse html page of website it crashes with the error: </p>
  
  <blockquote>
    <p>java.io.IOException:Mark has been invalidated.</p>
  </blockquote>
  
  <p>Part of my code:</p>
  
  <pre><code>String xml = xxxxxx;
  try {
      Document document = Jsoup.connect(xml).maxBodySize(1024*1024*10)
              .timeout(0).ignoreContentType(true)
              .parser(Parser.xmlParser()).get();
  
      Elements elements = document.body().select("td.hotv_text:eq(0)");
  
      for (Element element : elements) {
          Element element1 = element.select("a[href].hotv_text").first();
          hashMap.put(element.text(), element1.attr("abs:href"));
      }
  } catch (HttpStatusException ex) {
      Log.i("GyWueInetSvc", "Exception while JSoup connect:" + xml +" cause:"+ ex.getMessage());
  } catch (IOException e) {
      e.printStackTrace();
      throw new RuntimeException("Socket timeout: " + e.getMessage(), e);
  }
  </code></pre>
  
  <p>The size of website which I want parse is about 2MB.  And when I debug code I see that when in java package <code>ConstrainableInputStream.java</code> method: </p>
  
  <pre><code>public void reset() throws IOException {
      super.reset();remaining = maxSize - markpos;
  } 
  </code></pre>
  
  <p>and returns <code>markpos= -1</code> then goes to the exception. </p>
  
  <p>How can I solve that problem? </p>