Small performance improvement

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3921 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma
2011-01-26 14:43:34 +00:00
parent 174f609be4
commit 4b1ac128b1
@@ -65,10 +65,17 @@ final class BufferingSimpleClientHttpRequest extends AbstractBufferingClientHttp
this.connection.addRequestProperty(headerName, headerValue);
}
}
if (this.connection.getDoOutput()) {
this.connection.setFixedLengthStreamingMode(bufferedOutput.length);
}
this.connection.connect();
if (bufferedOutput.length > 0) {
if (this.connection.getDoOutput()) {
FileCopyUtils.copy(bufferedOutput, this.connection.getOutputStream());
}
return new SimpleClientHttpResponse(this.connection);
}