title: How to iterate multipart file upload request.getParts() by for loop by index value
body: <p>I am trying to upload files by multi part in android via servlets(server code). So i can iterate the loop like this.</p>
  
  <pre><code>for (Part part : request.getParts()) {
  //uploading current part.. working..
  } 
  </code></pre>
  
  <p>but i want to iterate like below,</p>
  
  <pre><code>  for (int i = 0; i &lt; request.getParts().size(); i++) {
      //request.getPart(i); not working..
     //request.getPart(i+1); not working..
      }
  </code></pre>
  
  <p>The reason is  need current part as well as next part on each and every iteration. Is it possible to do like above or any other ways to do it. How can I achieve this?</p>