title: Weird EOF Exception while trying to download file from GWT application
body: <p><br>
  I am trying to download a file from GWT client. At server side there is a servlet which generates content of file as per request and send it back to the client. </p>
  
  <p>Test Scenarios:
  <br><br>
  <b>Scenario 1 </b> If I hit url of servlet directly, it always give me desired result without any problems. </p>
  
  <p><b>Scenario 2 </b>
  Using GWT client on IE8,I am able to download file without any code changes. However on some other computer as soon as I try to write file content on response output stream, I get EOF exception.</p>
  
  <p>org.mortbay.jetty.EofException <br/>
   at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760)<br/>
   at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:566)<br/>
   at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:911)<br/>
   at java.io.BufferedOutputStream.flush(Unknown Source)<br/>
   atXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.doGet(ServiceDataExporterServlet.java:110)<br/>
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)<br/>
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)Creating input stream....<br/></p>
  
  <p>Code of servlet is as follows:
  <br></p>
  
  <p>try<br>
               { <br>
             output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);<br>
             byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; <br>
                int length; <br>
                int bytesWritten=0; <br>
                while ((length = data.read(buffer)) > 0) { <br>
                 bytesWritten+=length; <br>
                    output.write(buffer, 0, length); <br>
                }   <br>
  output.flush() // At this point I am facing EOF exception.
  <br>
  <br>
  where data is inputStream
  <br>
  <br>
  Via means of bytesWritten variable I have confirmed that in all the three scenarios content has been written in the same way in output stream. But not sure why it is not working in some computers.</p>
  
  <p><br>
  Any points will be highly appereciated.</p>