carterkozak commented on a change in pull request #221:
URL:
https://github.com/apache/httpcomponents-core/pull/221#discussion_r478615129
##########
File path:
httpcore5/src/main/java/org/apache/hc/core5/http/nio/entity/BasicAsyncEntityConsumer.java
##########
@@ -60,16 +60,7 @@ protected int capacityIncrement() {
@Override
protected void data(final ByteBuffer src, final boolean endOfStream)
throws IOException {
- if (src == null) {
- return;
- }
- if (src.hasArray()) {
- buffer.append(src.array(), src.arrayOffset() + src.position(),
src.remaining());
- } else {
- while (src.hasRemaining()) {
- buffer.append(src.get());
- }
- }
+ buffer.append(src);
Review comment:
This resolves an inconsistency where previously the src buffer position
would advance only if the buffer was not array backed.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]