You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2020/08/27 18:29:57 UTC
[GitHub] [httpcomponents-core] carterkozak commented on a change in pull request #221: HTTPCORE-649: Implement ByteArrayBuffer.append(ByteBuffer)
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org