Index: java/org/apache/commons/httpclient/HttpMethodBase.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v retrieving revision 1.159.2.30 diff -u -r1.159.2.30 HttpMethodBase.java --- java/org/apache/commons/httpclient/HttpMethodBase.java 27 Jul 2004 01:34:48 -0000 1.159.2.30 +++ java/org/apache/commons/httpclient/HttpMethodBase.java 9 Aug 2004 09:06:51 -0000 @@ -679,9 +679,10 @@ InputStream instream = getResponseBodyAsStream(); if (instream != null) { LOG.debug("Buffering response body"); - ByteArrayOutputStream outstream = new ByteArrayOutputStream(); + + ByteArrayOutputStream outstream = new ByteArrayOutputStream(4096); byte[] buffer = new byte[4096]; - int len; + int len = 0; while ((len = instream.read(buffer)) > 0) { outstream.write(buffer, 0, len); }