Fix a bug in AbstractByteBuf.writeZero() where the capacity is not auto-expanded
This commit is contained in:
parent
fc7c950b08
commit
f0a3f849f7
@ -862,8 +862,7 @@ public abstract class AbstractByteBuf extends ByteBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int writeBytes(ScatteringByteChannel in, int length)
|
public int writeBytes(ScatteringByteChannel in, int length) throws IOException {
|
||||||
throws IOException {
|
|
||||||
ensureWritable(length);
|
ensureWritable(length);
|
||||||
int writtenBytes = setBytes(writerIndex, in, length);
|
int writtenBytes = setBytes(writerIndex, in, length);
|
||||||
if (writtenBytes > 0) {
|
if (writtenBytes > 0) {
|
||||||
@ -878,6 +877,7 @@ public abstract class AbstractByteBuf extends ByteBuf {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensureWritable(length);
|
||||||
checkIndex(writerIndex, length);
|
checkIndex(writerIndex, length);
|
||||||
|
|
||||||
int nLong = length >>> 3;
|
int nLong = length >>> 3;
|
||||||
|
Loading…
Reference in New Issue
Block a user