title: get the PDF from a URL and push it to the clients browser for download
body: <p>I have PDFs mounted on an external server. I have to access them in my Java servlet and push them to the clients browser. The PDF should get downloaded directly or it may open a 'SAVE or OPEN' dialog window.
  This is what i am trying in my code but it could not do much.</p>
  
  <pre><code>URL url = new URL("http://www01/manuals/zseries.pdf");
  ByteArrayOutputStream bais = new ByteArrayOutputStream();
  InputStream in = url.openStream();
  
  int FILE_CHUNK_SIZE = 1024 * 4;
  byte[] chunk = new byte[FILE_CHUNK_SIZE]; 
  int n =0;
   while ( (n = in.read(chunk)) != -1 ) {
          bais.write(chunk, 0, n);
    }
  </code></pre>
  
  <p>I have tried many ways to do this but could not succeed. I welcome if you have any good method to do this!</p>