rem: var input = new java.io.BufferedInputStream(connection.getInputStream()); var body = new java.io.ByteArrayOutputStream(); var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024); var len; var currentSize = 0; var maxResponseSize = self.getMaxResponseSize(); while ((len = input.read(buf)) > -1) { body.write(buf, 0, len); currentSize += len; if (maxResponseSize && currentSize > maxResponseSize) { throw new Error("Maximum allowed response size is exceeded"); 
add: var input; try { input = new java.io.BufferedInputStream(connection.getInputStream()); } catch (error) { input = new java.io.BufferedInputStream(connection.getErrorStream()); } if (input) { var body = new java.io.ByteArrayOutputStream(); var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024); var len; var currentSize = 0; while ((len = input.read(buf)) > -1) { body.write(buf, 0, len); currentSize += len; if (maxResponseSize && currentSize > maxResponseSize) { throw new Error("Maximum allowed response size is exceeded"); } } try { input.close(); } catch (error) {  } if (binaryMode && (result.code >= 200 && result.code < 300)) {  result.content = body.toByteArray(); } else { result.content = result.charset ? body.toString(result.charset) : body.toString(); }  if (result.content) { result.length = result.content.length; 
context:     var responseHandler = function(connection, result) {       var input = new java.io.BufferedInputStream(connection.getInputStream());       var body = new java.io.ByteArrayOutputStream();       var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);       var len;       var currentSize = 0;       var maxResponseSize = self.getMaxResponseSize();       while ((len = input.read(buf)) > -1) {          body.write(buf, 0, len);          currentSize += len;          if (maxResponseSize && currentSize > maxResponseSize) {             throw new Error("Maximum allowed response size is exceeded");          }       }       input.close();       if (binaryMode) {          result.content = body.toByteArray();       } else {          result.content = result.charset ?                      body.toString(result.charset) :                      body.toString();       }    };
meta: 2504	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2504/6995b9b6a1552e9069195cb094d95f115dc0bcfa/Http.js/buggy/helma/Http.js