[#1439] Fix CompositeByteBuf.nioBufferCount() to return the correct number
This commit is contained in:
parent
c3034c8964
commit
bf046492fb
@ -976,7 +976,16 @@ public class DefaultCompositeByteBuf extends AbstractReferenceCountedByteBuf imp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int nioBufferCount() {
|
public int nioBufferCount() {
|
||||||
return components.size();
|
if (components.size() == 1) {
|
||||||
|
return components.get(0).buf.nioBufferCount();
|
||||||
|
} else {
|
||||||
|
int count = 0;
|
||||||
|
for (int i = 0; i < components.size(); i++) {
|
||||||
|
Component c = components.get(i);
|
||||||
|
count+= c.buf.nioBufferCount();
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user