Small performance improvement
This commit is contained in:
parent
f26b499cbd
commit
4e50eafe74
|
|
@ -65,10 +65,17 @@ final class BufferingSimpleClientHttpRequest extends AbstractBufferingClientHttp
|
||||||
this.connection.addRequestProperty(headerName, headerValue);
|
this.connection.addRequestProperty(headerName, headerValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.connection.getDoOutput()) {
|
||||||
|
this.connection.setFixedLengthStreamingMode(bufferedOutput.length);
|
||||||
|
}
|
||||||
|
|
||||||
this.connection.connect();
|
this.connection.connect();
|
||||||
if (bufferedOutput.length > 0) {
|
|
||||||
|
if (this.connection.getDoOutput()) {
|
||||||
FileCopyUtils.copy(bufferedOutput, this.connection.getOutputStream());
|
FileCopyUtils.copy(bufferedOutput, this.connection.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SimpleClientHttpResponse(this.connection);
|
return new SimpleClientHttpResponse(this.connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue