Fixed a bug where Channel.getBytes and setBytes don't update the argument's reader/writerIndex when relative indexing is used.
This commit is contained in:
parent
a1c07e9122
commit
6f30a4a748
@ -153,6 +153,7 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
|
|||||||
|
|
||||||
public void getBytes(int index, ChannelBuffer dst, int length) {
|
public void getBytes(int index, ChannelBuffer dst, int length) {
|
||||||
getBytes(index, dst, dst.writerIndex(), length);
|
getBytes(index, dst, dst.writerIndex(), length);
|
||||||
|
dst.writerIndex(dst.writerIndex() + length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBytes(int index, byte[] src) {
|
public void setBytes(int index, byte[] src) {
|
||||||
@ -165,6 +166,7 @@ public abstract class AbstractChannelBuffer implements ChannelBuffer {
|
|||||||
|
|
||||||
public void setBytes(int index, ChannelBuffer src, int length) {
|
public void setBytes(int index, ChannelBuffer src, int length) {
|
||||||
setBytes(index, src, src.readerIndex(), length);
|
setBytes(index, src, src.readerIndex(), length);
|
||||||
|
src.readerIndex(src.readerIndex() + length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setZero(int index, int length) {
|
public void setZero(int index, int length) {
|
||||||
|
Loading…
Reference in New Issue
Block a user