Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1095843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:11:24+00:00 2026-05-17T00:11:24+00:00

private static void writeData( byte[] file, HttpServletResponse response ) throws IOException { …. //

  • 0
private static void writeData( byte[] file, HttpServletResponse response )
    throws IOException
{
    ....
    // Send the data
    response.setContentLength(file.length);
    response.getOutputStream().write(file);
}

Recently, I’ve found in IE8 that some connections close while requesting files to download. This is the relevant piece of source in code, and I was wondering if writing large byte arrays all at once to the response output stream could cause this issue. The issue is very much non-reproducible, and I’ve often seen the pattern of writing a certain number of bytes at a time, versus all at once, to avoid MTU issues, or something like that.

Could this code be responsible for my intermittent IE issues? If so, why, and why only in IE?

Edit:

I tried using Cache-Control: no-cache, and the results were catastrophic in IE.

alt text

Request:

POST /myapplication/someAction.do?step=none&SAct=none HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/x-shockwave-flash, */*
Referer: https://myhost.myhost.com/myapplication/someAction.do?queryString=something
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; .NET4.0C; InfoPath.3)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: myhost.myhost.com
Content-Length: 1644
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=GnvHMYyGx9QrmpVQfBSgNXnPM8nQJ21dT82KhmSSTXRRT1mgB8tP!299858932; [truncated]

Response:

HTTP/1.1 200 OK
Cache-Control: no-cache
Date: Tue, 21 Sep 2010 18:00:56 GMT
Transfer-Encoding: chunked
Content-Type: application/ZIP
Content-Disposition: inline; filename=ActivityReport.ZIP
X-Powered-By: Servlet/2.5 JSP/2.1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:11:25+00:00Added an answer on May 17, 2026 at 12:11 am

    Are you setting response’s caching information? (dates, cache-control, etc.)

    I’ve seen this behavior in IE a lot, and always has to do with IE’s implementation of caching, instead of sending a HEAD request to check contents’ validity, it sends the full GET request and then uses headers to determine the validity of its cached content, if it decides the cached version is valid, then just closes the connection, so a lot of “broken pipe” style errors show up on server side.

    To verify this is the case, try sending cache control headers so IE always has to download the full content.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking at the code: private static void send(final Socket socket, final String data) throws
considering the following function private static void GetText(String nodeValue) throws IOException { if(!file3.exists()) {
I write a simple function like this: private static void write(String Swrite) throws IOException
here it is, using this function: private static void write(String Swrite) throws IOException {
private static void deleteProxy(File proxyOld, String host, int port) { try { String lines,
I will start off with the code... private static void File() { wixFile =
Main.java import java.io.IOException; public class Main { private final CompressedOutputStream m_cos; public static void
I have the following function: private static void prettyPrint(Document doc, File destFile) { TransformerFactory
private static void SaveOrRemove<T>(string key, T value) { if (value == null) { Console.WriteLine(Remove:
I'm currently using the following code (C#): private static void PlayLoop(string filename) { Audio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.