Removed unnecessary cast to int
Since Java7 HttpURLConnection offers setFixedLengthStreamingMode method with long parameter which should be prefered over version with int argument, therefore casting ContentLength to int is no longer needed. Moreover it makes impossible to stream payload larger than Integer.MAX_VALUE
This commit is contained in:
@@ -73,7 +73,7 @@ final class SimpleStreamingClientHttpRequest extends AbstractClientHttpRequest {
|
||||
protected OutputStream getBodyInternal(HttpHeaders headers) throws IOException {
|
||||
if (this.body == null) {
|
||||
if (this.outputStreaming) {
|
||||
int contentLength = (int) headers.getContentLength();
|
||||
long contentLength = headers.getContentLength();
|
||||
if (contentLength >= 0) {
|
||||
this.connection.setFixedLengthStreamingMode(contentLength);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user