Optimize derived buffers' forEachByte(...) implementation
- Related: #1378
This commit is contained in:
parent
b5bb36c087
commit
98531313de
@ -291,5 +291,10 @@ public class DuplicatedByteBuf extends AbstractDerivedByteBuf {
|
|||||||
public ByteBuffer internalNioBuffer(int index, int length) {
|
public ByteBuffer internalNioBuffer(int index, int length) {
|
||||||
return buffer.internalNioBuffer(index, length);
|
return buffer.internalNioBuffer(index, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int forEachByte(int fromIndex, int toIndex, ByteBufProcessor processor) {
|
||||||
|
return buffer.forEachByte(fromIndex, toIndex, processor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,6 +295,11 @@ public class ReadOnlyByteBuf extends AbstractDerivedByteBuf {
|
|||||||
return buffer.internalNioBuffer(index, length);
|
return buffer.internalNioBuffer(index, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int forEachByte(int fromIndex, int toIndex, ByteBufProcessor processor) {
|
||||||
|
return buffer.forEachByte(fromIndex, toIndex, processor);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int capacity() {
|
public int capacity() {
|
||||||
return buffer.capacity();
|
return buffer.capacity();
|
||||||
|
@ -273,4 +273,9 @@ public class SlicedByteBuf extends AbstractDerivedByteBuf {
|
|||||||
checkIndex(index, length);
|
checkIndex(index, length);
|
||||||
return buffer.internalNioBuffer(index + adjustment, length);
|
return buffer.internalNioBuffer(index + adjustment, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int forEachByte(int fromIndex, int toIndex, ByteBufProcessor processor) {
|
||||||
|
return buffer.forEachByte(fromIndex + adjustment, toIndex + adjustment, processor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user