ok2c commented on a change in pull request #161: EntityUtils clean ups and
internal refactoring
URL:
https://github.com/apache/httpcomponents-core/pull/161#discussion_r347289029
##########
File path:
httpcore5/src/main/java/org/apache/hc/core5/http/io/entity/EntityUtils.java
##########
@@ -107,12 +117,8 @@ public static void consume(final HttpEntity entity)
throws IOException {
if (inStream == null) {
return null;
}
- int i = (int) Args.checkContentLength(entity);
- if (i < 0) {
- i = 4096;
- }
- final ByteArrayBuffer buffer = new ByteArrayBuffer(i);
- final byte[] tmp = new byte[4096];
+ final ByteArrayBuffer buffer = new
ByteArrayBuffer(getCheckedContentLength(entity));
Review comment:
@michael-o Anyone in their mind should never be using `EntityUtils#toString`
in the first place. I do not think there is anything to be done here other than
saying that one ought not use this method in production.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]